abdallah-odeh / flutter_file_downloader

A simple plugin that downloads files to downloads directory in all android versions
BSD 3-Clause "New" or "Revised" License
21 stars 8 forks source link

Fatal Exception: java.lang.NullPointerException #54

Open bettkipronoh opened 4 weeks ago

bettkipronoh commented 4 weeks ago

Describe the bug

Got a null point exception from firebase crashlytics Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void z6.k.c(java.lang.String, java.lang.Object)' on a null object reference at com.odehbros.flutter_file_downloader.MethodCallHandlerImpl$2.onProgress(MethodCallHandlerImpl.java:300) at com.odehbros.flutter_file_downloader.downloader.DownloadManagerService.lambda$trackDownload$3(DownloadManagerService.java:178) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:703) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:923)

abdallah-odeh commented 4 weeks ago

Hello @bettkipronoh, sorry for the late response what is the plugin version you are using? also is it possible to provide me with the link you requested to download & device info (sdk version at least)

bettkipronoh commented 3 weeks ago

Hello @abdallah-odeh , Am using flutter_file_downloader: ^2.0.0 Unfortunately I can't provide the url because the exception was caught by firebase crashlytics from a user's device.

abdallah-odeh commented 3 weeks ago

I'll investigate in the bug and tell you what I found Thanks for reporting

abdallah-odeh commented 2 weeks ago

Hello @bettkipronoh, did you face this issue a lot? actually I could not figure out the cause of the bug so I wrapped it with try & catch to avoid app to crash

bettkipronoh commented 1 week ago

Yes many users are affected. Here is firebase screenshot Once you publish it i will update the app and let you know. Screenshot from 2024-09-04 16-03-08

abdallah-odeh commented 1 week ago

Sorry to hear that, I will deploy a version today that avoids app crash, I believe that the file get downloaded indeed but the callback never gets fired; so basically the code sees the task still in progress

abdallah-odeh commented 1 week ago

I deployed a new version flutter_file_downloader: ^2.0.1-dev.2, please try it out & tell me if works fine to roll it to production