TeamNewPipe / NewPipe-legacy

NewPipe with support for older devices
GNU General Public License v3.0
131 stars 36 forks source link

Crash during boot loading, "Android Box SH940C-LN android jelly bean" #38

Closed ElSicario22 closed 3 years ago

ElSicario22 commented 4 years ago

please fix this. NewPipe Legacy error on "ANDROID BOX SH940C-LN" android versi jelly bean

Exception

java.lang.NoSuchMethodError: android.view.ViewGroup.getOverlay
    at org.schabi.newpipelegacy.views.FocusOverlayView.setupOverlay(FocusOverlayView.java:203)
    at org.schabi.newpipelegacy.views.FocusOverlayView.setupFocusObserver(FocusOverlayView.java:198)
    at org.schabi.newpipelegacy.MainActivity.onCreate(MainActivity.java:143)
    at android.app.Activity.performCreate(Activity.java:5104)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
    at android.app.ActivityThread.access$600(ActivityThread.java:141)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5041)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    at dalvik.system.NativeStart.main(Native Method)


blackbox87 commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer.

Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

ZacharyFoxx commented 4 years ago

I have used Legacy on OUYA, Linux Android 4.1.2 - 16, and I had the same problem. Until version 0.18.6 it is working.

ElSicario22 commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer.

Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

How do I apply this? I don't understand programming, and I don't have a computer, the only devices I have are an android phone (6.0) and an android tv box (4.2.2 Jelly Bean). Can you fix this? And send me the fixed legacy newpipe app to me? I am very grateful if you did that, please

ZacharyFoxx commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer. Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

How do I apply this? I don't understand programming, and I don't have a computer, the only devices I have are an android phone (6.0) and an android tv box (4.2.2 Jelly Bean). Can you fix this? And send me the fixed legacy newpipe app to me? I am very grateful if you did that, please

Take it easy =). If you read it, there is already an pull request, "Layout fixes # 31", about that. For now, you can use version 0.18.6, which works perfectly.

ElSicario22 commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer. Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

How do I apply this? I don't understand programming, and I don't have a computer, the only devices I have are an android phone (6.0) and an android tv box (4.2.2 Jelly Bean). Can you fix this? And send me the fixed legacy newpipe app to me? I am very grateful if you did that, please

Take it easy =). If you read it, there is already an pull request, "Layout fixes # 31", about that. For now, you can use version 0.18.6, which works perfectly.

But after i used version 0.18.6 a crash like this .{ "user_action": "searched", "request": "wg lunatic", "content_language": "ID", "service": "YouTube", "package": "org.schabi.newpipelegacy", "version": "0.18.6", "os": "Linux Android 4.2.2 - 17", "time": "2020-09-02 08:20", "exceptions": [ "java.lang.NullPointerException: Attempt to invoke virtual method 'com.grack.nanojson.JsonArray com.grack.nanojson.JsonObject.getArray(java.lang.String)' on a null object reference\n\tat org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor.getInitialPage(YoutubeSearchExtractor.java:87)\n\tat org.schabi.newpipe.extractor.utils.ExtractorHelper.getItemsPageOrLogError(ExtractorHelper.java:19)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:50)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:30)\n\tat org.schabi.newpipelegacy.util.ExtractorHelper.lambda$searchFor$0(ExtractorHelper.java:77)\n\tat org.schabi.newpipelegacy.util.-$$Lambda$ExtractorHelper$-8aHvL55sR85zE6IsKXH93CdRds.call(lambda)\n\tat io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)\n\tat io.reactivex.Single.subscribe(Single.java:3438)\n\tat io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)\n\tat io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:237)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\n\tat java.lang.Thread.run(Thread.java:818)\n" ], "user_comment": "" }

ZacharyFoxx commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer. Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

How do I apply this? I don't understand programming, and I don't have a computer, the only devices I have are an android phone (6.0) and an android tv box (4.2.2 Jelly Bean). Can you fix this? And send me the fixed legacy newpipe app to me? I am very grateful if you did that, please

Take it easy =). If you read it, there is already an pull request, "Layout fixes # 31", about that. For now, you can use version 0.18.6, which works perfectly.

But after i used version 0.18.6 a crash like this .{ "user_action": "searched", "request": "wg lunatic", "content_language": "ID", "service": "YouTube", "package": "org.schabi.newpipelegacy", "version": "0.18.6", "os": "Linux Android 4.2.2 - 17", "time": "2020-09-02 08:20", "exceptions": [ "java.lang.NullPointerException: Attempt to invoke virtual method 'com.grack.nanojson.JsonArray com.grack.nanojson.JsonObject.getArray(java.lang.String)' on a null object reference\n\tat org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor.getInitialPage(YoutubeSearchExtractor.java:87)\n\tat org.schabi.newpipe.extractor.utils.ExtractorHelper.getItemsPageOrLogError(ExtractorHelper.java:19)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:50)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:30)\n\tat org.schabi.newpipelegacy.util.ExtractorHelper.lambda$searchFor$0(ExtractorHelper.java:77)\n\tat org.schabi.newpipelegacy.util.-$$Lambda$ExtractorHelper$-8aHvL55sR85zE6IsKXH93CdRds.call(lambda)\n\tat io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)\n\tat io.reactivex.Single.subscribe(Single.java:3438)\n\tat io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)\n\tat io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:237)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\n\tat java.lang.Thread.run(Thread.java:818)\n" ], "user_comment": "" }

Did The program open or just close? If opened, what did you try to do?

ElSicario22 commented 4 years ago

It's detected as an Android TV box correctly, so it gets to here and then it fails because getOverlay() requires [Android 4.3](https://developer.android.com/reference/android/view/ViewGroup#getOverlay()) or newer. Maybe something like this would at least get NewPipe to function for you.

    public static void setupFocusObserver(final Dialog dialog) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = dialog.getWindow();
        assert window != null;

        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(dialog.getContext());
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

    public static void setupFocusObserver(final Activity activity) {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2)
            return;
        Rect displayRect = new Rect();

        Window window = activity.getWindow();
        View decor = window.getDecorView();
        decor.getWindowVisibleDisplayFrame(displayRect);

        FocusOverlayView overlay = new FocusOverlayView(activity);
        overlay.setBounds(0, 0, displayRect.width(), displayRect.height());

        setupOverlay(window, overlay);
    }

Android Studio would normally warn you about issues like this and fail to compile the app, but for some reason NewPipe Legacy is setup to ignore these warnings. IMO this behavior should be changed @friendlyanon @TobiGr.

How do I apply this? I don't understand programming, and I don't have a computer, the only devices I have are an android phone (6.0) and an android tv box (4.2.2 Jelly Bean). Can you fix this? And send me the fixed legacy newpipe app to me? I am very grateful if you did that, please

Take it easy =). If you read it, there is already an pull request, "Layout fixes # 31", about that. For now, you can use version 0.18.6, which works perfectly.

But after i used version 0.18.6 a crash like this .{ "user_action": "searched", "request": "wg lunatic", "content_language": "ID", "service": "YouTube", "package": "org.schabi.newpipelegacy", "version": "0.18.6", "os": "Linux Android 4.2.2 - 17", "time": "2020-09-02 08:20", "exceptions": [ "java.lang.NullPointerException: Attempt to invoke virtual method 'com.grack.nanojson.JsonArray com.grack.nanojson.JsonObject.getArray(java.lang.String)' on a null object reference\n\tat org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSearchExtractor.getInitialPage(YoutubeSearchExtractor.java:87)\n\tat org.schabi.newpipe.extractor.utils.ExtractorHelper.getItemsPageOrLogError(ExtractorHelper.java:19)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:50)\n\tat org.schabi.newpipe.extractor.search.SearchInfo.getInfo(SearchInfo.java:30)\n\tat org.schabi.newpipelegacy.util.ExtractorHelper.lambda$searchFor$0(ExtractorHelper.java:77)\n\tat org.schabi.newpipelegacy.util.-$$Lambda$ExtractorHelper$-8aHvL55sR85zE6IsKXH93CdRds.call(lambda)\n\tat io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:44)\n\tat io.reactivex.Single.subscribe(Single.java:3438)\n\tat io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)\n\tat io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:578)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)\n\tat io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:237)\n\tat java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\n\tat java.lang.Thread.run(Thread.java:818)\n" ], "user_comment": "" }

Did The program open or just close? If opened, what did you try to do?

It opens and can enter the homepage normally, but when selecting video and play it crashes Same when searching for a video in the search field, always crashes, Is there a solution for me to be able to watch YouTube on this old & low end android tv box? I have tried many applications but they don't work perfectly, like yt vanced / OGyt / vidmate, which is almost perfect, only newpipe but after the 0.19 update it always crashes

blackbox87 commented 4 years ago

Take it easy =). If you read it, there is already an pull request, "Layout fixes # 31", about that. For now, you can use version 0.18.6, which works perfectly.

My pull request doesn't contain a fix for this issue. I just posted a comment with a possible fix, which @friendlyanon should be able to include when they release the next update.

ShareASmile commented 3 years ago

Is it ok for you to upload the apk with fix here @blackbox87 ?

blackbox87 commented 3 years ago

Anyone is welcome to download my version and compile it for themselves. I won't share a build here though because the devs have previously asked people not to post unofficial versions in issue reports such as this one.

@friendlyanon @TobiGr @B0pol Trying to merge the unified player UI into NewPipe Legacy was a mistake IMO. And it obviously wasn't well tested on Android 4.1-4.4 devices as it's introduced dozens of new UI issues. Like I'm seeing text over avatars, overlapping buttons and the player constantly flickers if you scroll down the page even a little.

I rolled back to v0.19.9 and then applied some extra fixes on top, which gives me a perfectly working version of NewPipe for all devices. And it's great for anyone who isn't a fan of the unified player UI in general.

ZacharyFoxx commented 3 years ago

Anyone is welcome to download my version and compile it for themselves. I won't share a build here though because the devs have previously asked people not to post unofficial versions in issue reports such as this one.

@friendlyanon @TobiGr @B0pol Trying to merge the unified player UI into NewPipe Legacy was a mistake IMO. And it obviously wasn't well tested on Android 4.1-4.4 devices as it's introduced dozens of new UI issues. Like I'm seeing text over avatars, overlapping buttons and the player constantly flickers if you scroll down the page even a little.

I rolled back to v0.19.9 and then applied some extra fixes on top, which gives me a perfectly working version of NewPipe for all devices. And it's great for anyone who isn't a fan of the unified player UI in general.

I tested the version 0.20.2 and it worked, but as you said, with UI issues as text over avatars and others related with commands like "auto play" option appearing mixed with the text "next".

ShareASmile commented 3 years ago

I won't share a build here though [because the devs have previously asked people not to post unofficial versions in issue reports such as this one.

..but you can share apk build on your fork (if you want) by including source code hence by complying license conditions under GPL3. I have seen your work on NewPipe that's awesome.

to merge the unified player UI into NewPipe Legacy was a mistake IMO. And it obviously wasn't well tested on Android 4.1-4.4 devices as it's introduced dozens of new UI problems.

Fully Agree. Though i thought @TobiGr was trying to release 0.19.9 Legacy pre-unified but build failed. I maybe wrong.

I rolled back to v0.19.9 and then applied some extra fixes on top, which gives me a perfectly working version of NewPipe for all devices. And it's great for anyone who isn't a fan of the unified player UI in general.

Thanks for all the work @blackbox87 "You are always willing to help" having seen your work on NewPipe and Legacy repo i can say that for sure.

Still it would be great if you share your build on your fork as most of the users cannot build app by themselves by installing android studio. If need any help i am available, though i am not a computer programmer but a learner.

blackbox87 commented 3 years ago

@ShareASmile I've uploaded an APK. It includes 1 additional commit to disable update checks and error reports.

The extractor might fail to retrieve the comments for some videos. It's a known bug and they're working on fixing it.

@ElSicario22 You might want to try my version too as it should fix your problem.