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

Crashing when downloading because of SAF #6687

Closed
4 tasks done
castrik opened this issue Jul 17, 2021 · 21 comments · Fixed by #6721 or #6778
Closed
4 tasks done

Crashing when downloading because of SAF #6687

castrik opened this issue Jul 17, 2021 · 21 comments · Fixed by #6721 or #6778
Labels
bug Issue is related to a bug downloader Issue is related to the downloader

Comments

@castrik
Copy link

castrik commented Jul 17, 2021

Checklist

Steps to reproduce the bug

download any video or go to see download folder in the app, app restarts a couple of time and crashes

happening only if I enable SAF, its default in 0.21.6 also happens in 0.21.5 if I enabled it

but in 0.21.5, I could atleast see my downloads folder, in 0.21.6 it crashes in both cases, seeing the downloads folder or downloading a video/audio

Actual behavior

Expected behavior

Screenshots/Screen recordings

Screen_Recording_20210717-131612_NewPipe.mp4

Logs

`## Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: US
  • Content Language: en-US
  • App Language: en_US
  • Service: none
  • Version: 0.21.6
  • OS: Linux Android 10 - 29
Crash log

java.lang.RuntimeException: Unable to create service us.shandian.giga.service.DownloadManagerService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4412)
	at android.app.ActivityThread.access$1800(ActivityThread.java:274)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2118)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:237)
	at android.app.ActivityThread.main(ActivityThread.java:8167)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at us.shandian.giga.service.DownloadManager.loadPendingMissions(DownloadManager.java:165)
	at us.shandian.giga.service.DownloadManager.<init>(DownloadManager.java:77)
	at us.shandian.giga.service.DownloadManagerService.onCreate(DownloadManagerService.java:142)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4400)
	... 8 more


`

Device info

  • Android version/Custom ROM version:
  • Device model:
@castrik castrik added the bug Issue is related to a bug label Jul 17, 2021
@bew
Copy link

bew commented Jul 17, 2021

I have the same crash & behavior.
What is SAF ?

@castrik
Copy link
Author

castrik commented Jul 17, 2021

What is SAF ?

read the blog post of the update release
https://newpipe.net/blog/pinned/release/newpipe-0.21.6-released/

@bew
Copy link

bew commented Jul 17, 2021

Thanks! I tried to disable SAF, but I still get the same error:

Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: GB
  • Content Language: en
  • App Language: en_US
  • Service: none
  • Version: 0.21.6
  • OS: Linux Android 9 - 28
Crash log

java.lang.RuntimeException: Unable to create service us.shandian.giga.service.DownloadManagerService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3579)
	at android.app.ActivityThread.access$1300(ActivityThread.java:197)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1669)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6671)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at us.shandian.giga.service.DownloadManager.loadPendingMissions(DownloadManager.java:165)
	at us.shandian.giga.service.DownloadManager.<init>(DownloadManager.java:77)
	at us.shandian.giga.service.DownloadManagerService.onCreate(DownloadManagerService.java:142)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:3567)
	... 8 more

@triallax triallax added downloader Issue is related to the downloader more info needed labels Jul 17, 2021
@timjefferies
Copy link

Same issue for me. I'm on Android 11 so no option to disable.

`## Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en
  • Service: none
  • Version: 0.21.6
  • OS: Linux Android 11 - 30
Crash log

java.lang.RuntimeException: Unable to create service us.shandian.giga.service.DownloadManagerService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4198)
	at android.app.ActivityThread.access$1500(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7660)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at us.shandian.giga.service.DownloadManager.loadPendingMissions(DownloadManager.java:165)
	at us.shandian.giga.service.DownloadManager.<init>(DownloadManager.java:77)
	at us.shandian.giga.service.DownloadManagerService.onCreate(DownloadManagerService.java:142)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4186)
	... 8 more


`

@skyGtm
Copy link

skyGtm commented Jul 19, 2021

It seems to have fixed.
You guys should try debug apk from this PR. #6701

@Stypox
Copy link
Member

Stypox commented Jul 19, 2021

@skyGtm again, that PR is unrelated ;-)

@bew bew mentioned this issue Jul 20, 2021
@timjefferies
Copy link

Issue remains on version 0.21.7

`## Exception

  • User Action: ui error
  • Request: ACRA report
  • Content Country: GB
  • Content Language: en-GB
  • App Language: en
  • Service: none
  • Version: 0.21.7
  • OS: Linux Android 11 - 30
Crash log

java.lang.RuntimeException: Unable to create service us.shandian.giga.service.DownloadManagerService: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4198)
	at android.app.ActivityThread.access$1500(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7660)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.schabi.newpipe.streams.io.StoredFileHelper.toString()' on a null object reference
	at us.shandian.giga.service.DownloadManager.loadPendingMissions(DownloadManager.java:165)
	at us.shandian.giga.service.DownloadManager.<init>(DownloadManager.java:77)
	at us.shandian.giga.service.DownloadManagerService.onCreate(DownloadManagerService.java:142)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4186)
	... 8 more


`

@Stypox
Copy link
Member

Stypox commented Jul 21, 2021

@timjefferies @bew @castrik does #6721 fix the problem for you?

@castrik
Copy link
Author

castrik commented Jul 21, 2021

@timjefferies @bew @castrik does #6721 fix the problem for you?

thank you, works flawlessly now

@massyas
Copy link

massyas commented Jul 22, 2021

Hello,
I also have the same issue on Android 10 (Oxygen OS 10.3.11 on OnePlus 6) and even with version 0.21.7 crash is still there.
I tried to reset the download folder once SAF has been enabled by default but without success.

@TobiGr
Copy link
Contributor

TobiGr commented Jul 22, 2021

@massyas Did you test the APK from #6721?

@massyas
Copy link

massyas commented Jul 22, 2021

Hello @TobiGr
My mistake, I thought the fix was already integrated in 0.21.7
It works perfect with debug APK from #6721
Thanks !

@massyas
Copy link

massyas commented Jul 23, 2021

Hello @TobiGr
Unfortunately the problem has reappeared at my side on the debug version with a different stack apparently but same consequence

java.lang.RuntimeException: Unable to create service us.shandian.giga.service.DownloadManagerService: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.exists()' on a null object reference
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4082)
	at android.app.ActivityThread.access$1800(ActivityThread.java:231)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1968)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7682)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.exists()' on a null object reference
	at org.schabi.newpipe.streams.io.StoredFileHelper.existsAsFile(StoredFileHelper.java:295)
	at us.shandian.giga.get.DownloadMission.hasInvalidStorage(DownloadMission.java:667)
	at us.shandian.giga.service.DownloadManager.loadPendingMissions(DownloadManager.java:152)
	at us.shandian.giga.service.DownloadManager.<init>(DownloadManager.java:77)
	at us.shandian.giga.service.DownloadManagerService.onCreate(DownloadManagerService.java:142)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4070)

Hope this can help...

@Stypox
Copy link
Member

Stypox commented Jul 27, 2021

@massyas could you test #6778?

@massyas
Copy link

massyas commented Jul 27, 2021

@massyas could you test #6778?

Hello @Stypox , #6778 apk seems to work ok. I set the same download folder as before and tried to download several videos with success.
Thanks 👍

@Stypox
Copy link
Member

Stypox commented Aug 4, 2021

@Movisivi please provide a crash report

@subsonik
Copy link

subsonik commented Aug 4, 2021

I'm having the same issue.

When "Ask where to download" is enabled, I click Download, select Audio/Video, click OK, the file chooser pops up (MiXplorer in my case), I select a folder, but then NewPipe says "Action denied by the system". The "Files and media" permission is granted.

If "Ask where to download" is disabled and I try to select a "Video/Audio download folder", the app just exits without error.

@Stypox
Copy link
Member

Stypox commented Aug 4, 2021

@subsonik do other apps using SAF work on your system?

@bew

This comment has been minimized.

@Stypox
Copy link
Member

Stypox commented Aug 4, 2021

I thought this fix was included in this last release, was it not?

No, it wasn't, 0.21.8 was a hotfix release for youtube, just look at the release notes. You can test 0.21.9 though: #6841

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 downloader Issue is related to the downloader
Projects
None yet
10 participants