lisen87 / image_pickers

图片多选并压缩,保存图片到相册,视频多选,预览图片和视频
Apache License 2.0
90 stars 59 forks source link

选择图片返回的时候,会出现空指针异常,小米真机 Android 10 环境 #25

Closed bingbing888 closed 1 year ago

bingbing888 commented 4 years ago

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.typrojectadministration, PID: 4225 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=102, result=-1, data=Intent { (has extras) }} to activity {com.typrojectadministration/com.typrojectadministration.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:4912) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4953) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:227) at android.app.ActivityThread.main(ActivityThread.java:7544) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953) Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference at com.leeson.image_pickers.ImagePickersPlugin$1.onActivityResult(ImagePickersPlugin.java:49) at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546) at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594) at android.app.Activity.dispatchActivityResult(Activity.java:8249) at android.app.ActivityThread.deliverResults(ActivityThread.java:4905) at android.app.ActivityThread.handleSendResult(ActivityThread.java:4953)  at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:227)  at android.app.ActivityThread.main(ActivityThread.java:7544)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:953)  E/MQSEventManagerDelegate: failed to get MQSService.

peak77 commented 4 years ago

同样遇到这个情况,你的解决了吗?

lisen87 commented 4 years ago

更新了1.0.7+2,找了个小米10测试没有问题,更新看看吧,并适配了android Q的图片存储

lisen87 commented 4 years ago

需要注意最低支持的安卓版本是 minSdkVersion 19