flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

java.lang.NullPointerException in production app

Open menasiephrem opened this issue 3 years ago • 3 comments

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.

Screen Shot 2022-02-04 at 09 14 48

Thanks.

menasiephrem avatar Feb 04 '22 06:02 menasiephrem

Why do you don't update to the latest version of Flutter and this plugin?

hnvn avatar Feb 04 '22 08:02 hnvn

@hnvn, I will. do you think that would be a definite solution for the problem?

menasiephrem avatar Feb 04 '22 11:02 menasiephrem

I updated the plugin and flutter to the latest version but the problem still persists.

menasiephrem avatar Mar 08 '22 12:03 menasiephrem

Any news about?

lugael avatar Nov 19 '22 16:11 lugael

@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.

menasiephrem avatar Nov 19 '22 17:11 menasiephrem