Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crash when starting NewPipe after it was removed from RAM #4921

Merged

Conversation

Isira-Seneviratne
Copy link
Member

@Isira-Seneviratne Isira-Seneviratne commented Nov 19, 2020

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

APK testing

app-debug.zip

Due diligence

@TobiGr TobiGr added the bug Issue is related to a bug label Nov 19, 2020
@opusforlife2
Copy link
Collaborator

April's Fool? There's no APK to test. xD

@Isira-Seneviratne
Copy link
Member Author

April's Fool? There's no APK to test. xD

My bad :P
I've uploaded an APK now.

@opusforlife2
Copy link
Collaborator

Fixed!

Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@TobiGr TobiGr merged commit 4700f35 into TeamNewPipe:dev Nov 20, 2020
@Isira-Seneviratne Isira-Seneviratne deleted the Call_offsetDateTime_instead_of_date branch November 21, 2020 06:29
@opusforlife2 opusforlife2 changed the title Call DateWrapper's offsetDateTime() instead of date(). Fixed crash when starting NewPipe after it was removed from RAM Nov 23, 2020
@richq richq mentioned this pull request Nov 24, 2020
@opusforlife2
Copy link
Collaborator

@Isira-Seneviratne This worked for the debug build, but in the 0.20.4 release Newpipe keeps crashing and opening in an infinite loop, just like another open issue here describes.

Could you test this with both a debug and a release build?

@Isira-Seneviratne
Copy link
Member Author

@Isira-Seneviratne This worked for the debug build, but in the 0.20.4 release Newpipe keeps crashing and opening in an infinite loop, just like another open issue here describes.

Could you test this with both a debug and a release build?

I think the issue you're talking about has been fixed here.

@opusforlife2
Copy link
Collaborator

Sure? There is no crash report involved here. Just loading Newpipe after it's booted from RAM. I could ask for a release build there if you're certain, though.

@Isira-Seneviratne
Copy link
Member Author

Sure? There is no crash report involved here. Just loading Newpipe after it's booted from RAM. I could ask for a release build there if you're certain, though.

I'll apply the changes and see if I encounter any issues.

@Isira-Seneviratne
Copy link
Member Author

After making ErrorInfo's constructor public, the error activity displays without issue.

Screenshot_20201127-161734701

@opusforlife2
Copy link
Collaborator

Wait, I'm confused now.

When I reported the issue and you provided a debug build to test, it worked fine.

But the 0.20.4 release build doesn't work. Assuming there were no changes to the relevant code between this PR and the release, that means something is going wrong in the release builds.

Even after that public constructor PR is merged, it still leaves the problem that Newpipe is crashing upon resuming if it was removed from RAM. Somehow, this is fixed in debug builds, but not in release builds.

Is that correct?

@Isira-Seneviratne
Copy link
Member Author

Wait, I'm confused now.

When I reported the issue and you provided a debug build to test, it worked fine.

But the 0.20.4 release build doesn't work. Assuming there were no changes to the relevant code between this PR and the release, that means something is going wrong in the release builds.

Even after that public constructor PR is merged, it still leaves the problem that Newpipe is crashing upon resuming if it was removed from RAM. Somehow, this is fixed in debug builds, but not in release builds.

Is that correct?

I tried minimizing and then restoring the app, but I didn't encounter any issues 😕

@opusforlife2
Copy link
Collaborator

:O

So if you open a bunch of RAM hungry apps again and again and then try to resume a paused video in the main player, it restores state successfully? (The 'Minimize' setting should be set to 'None' so that there is no notification when the main player is paused.)

@Isira-Seneviratne
Copy link
Member Author

I didn't encounter any issues with that setting either

@opusforlife2
Copy link
Collaborator

ಠ▃ಠ

This calls for a logcat.

Newpipe.txt

@Isira-Seneviratne
Copy link
Member Author

ಠ▃ಠ

This calls for a logcat.

Newpipe.txt

It seems like an issue with ErrorInfo's constructor, but that shouldn't be the case, it's now a public constructor.

@opusforlife2
Copy link
Collaborator

opusforlife2 commented Nov 29, 2020

This is the 0.20.4 release. It looks like I'll need a release build of the ErrorInfo PR.

@XiangRongLin Could you upload a release APK with your change, please?

Edit: Never mind! I see that 0.20.5 is about to be released.

@opusforlife2
Copy link
Collaborator

Yoohoo! Now that 0.20.5 is finally out, I could get a proper error report.

It's the same exception as the original, but from a different function this time.

Exception

  • User Action: ui error
  • Request: App crash, UI failure
  • Content Country: CH
  • Content Language: en-IN
  • App Language: en_IN
  • Service: none
  • Version: 0.20.5
  • OS: Linux Android 9 - 28
Crash log

java.lang.NullPointerException: Attempt to invoke virtual method 'char java.lang.String.charAt(int)' on a null object reference
	at j$.util.DesugarGregorianCalendar.from(:1)
	at org.schabi.newpipe.util.Localization.relativeTime(Localization.java:317)
	at org.schabi.newpipe.info_list.holder.StreamInfoItemHolder.getFormattedRelativeUploadDate(StreamInfoItemHolder.java:98)
	at org.schabi.newpipe.info_list.holder.StreamInfoItemHolder.getStreamInfoDetailLine(StreamInfoItemHolder.java:83)
	at org.schabi.newpipe.info_list.holder.StreamInfoItemHolder.updateFromItem(StreamInfoItemHolder.java:65)
	at org.schabi.newpipe.info_list.InfoListAdapter.onBindViewHolder(InfoListAdapter.java:337)
	at org.schabi.newpipe.info_list.InfoListAdapter.onBindViewHolder(InfoListAdapter.java:360)
	at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
	at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
	at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
	at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
	at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
	at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
	at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
	at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
	at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1083)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:148)
	at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899)
	at com.google.android.material.bottomsheet.BottomSheetBehavior.onLayoutChild(BottomSheetBehavior.java:414)
	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at androidx.drawerlayout.widget.DrawerLayout.onLayout(DrawerLayout.java:1231)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
	at com.android.internal.policy.DecorView.onLayout(DecorView.java:753)
	at android.view.View.layout(View.java:20693)
	at android.view.ViewGroup.layout(ViewGroup.java:6194)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2799)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2316)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1463)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7190)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
	at android.view.Choreographer.doCallbacks(Choreographer.java:761)
	at android.view.Choreographer.doFrame(Choreographer.java:696)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6718)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)


@Stypox
Copy link
Member

Stypox commented Dec 1, 2020

@Isira-Seneviratne ^

@Isira-Seneviratne
Copy link
Member Author

I'll check it out.

It seems like the zone ID is being set to null for whatever reason, even though its documentation explicitly says that it's non-null.

@Isira-Seneviratne
Copy link
Member Author

It's working fine on my device 😕

Screenshot 2020-12-02 090258.png

In any case, I have a potential workaround, and I'll link to it here. @opusforlife2 could you see if it works for you?

@Isira-Seneviratne
Copy link
Member Author

#5067

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants