flutter_downloader
flutter_downloader copied to clipboard
java.lang.NullPointerException in production app
Hi,
First, thank you for an awesome library 😄.
I am using flutter_downloader: ^1.6.0 and Flutter 2.7
I built an app that downloads music and plays it and I have tested everything on multiple devices locally and everything seems to work but after deploying it on google play, Firebase started to report a lot of crushes with the following stack trace
java.lang.NullPointerException: at io.flutter.embedding.engine.h.d.f (Unknown Source:2) at vn.hunghd.flutterdownloader.DownloadWorker.M (Unknown Source:30) at vn.hunghd.flutterdownloader.DownloadWorker.r (Unknown Source) at vn.hunghd.flutterdownloader.DownloadWorker$a.run (Unknown Source:4) at android.os.Handler.handleCallback (Handler.java:938) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loop (Looper.java:246) at android.app.ActivityThread.main (ActivityThread.java:8587) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)
This is all the info I am getting. I tried to reproduce it locally but failed. I don't know what I am missing. The crush doesn't affect all users I have attached the report as an image here if that helps.
Thanks.
Why do you don't update to the latest version of Flutter and this plugin?
@hnvn, I will. do you think that would be a definite solution for the problem?
I updated the plugin and flutter to the latest version but the problem still persists.
Any news about?
@lugael updated to the latest lib and also added @pragma('vm:entry-point')
after reading the doc that says
@pragma('vm:entry-point') must be placed above the callback function to avoid tree shaking in release mode for Android.