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

java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference #5

Closed
crazecoder opened this issue Mar 29, 2019 · 1 comment
Labels
need more information Need more information

Comments

@crazecoder
Copy link

CustomCacheManager().getFile(imageUrl).listen((_info){
      print("--------------${_info.file.path}");
      ShareExtend.share(_info.file.path, "image");
    });

print

I/flutter (10823): --------------/data/user/0/com.example.example/cache/customCache/2ae80350-3260-11e9-95f4-fd084d457e91.jpeg

Android

E/MethodChannel#share_extend(10823): Failed to handle method call
E/MethodChannel#share_extend(10823): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:605)
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
E/MethodChannel#share_extend(10823): 	at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareUtils.getUriForFile(ShareUtils.java:29)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareExtendPlugin.share(ShareExtendPlugin.java:81)
E/MethodChannel#share_extend(10823): 	at com.zt.shareextend.ShareExtendPlugin.onMethodCall(ShareExtendPlugin.java:51)
E/MethodChannel#share_extend(10823): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#share_extend(10823): 	at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188)
E/MethodChannel#share_extend(10823): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202)
E/MethodChannel#share_extend(10823): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#share_extend(10823): 	at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#share_extend(10823): 	at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#share_extend(10823): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#share_extend(10823): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#share_extend(10823): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#share_extend(10823): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Flutter

E/flutter (10823): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference, null)
E/flutter (10823): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (10823): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (10823): <asynchronous suspension>
E/flutter (10823): #2      ShareExtend.share (package:share_extend/share_extend.dart:37:21)
E/flutter (10823): #3      ExamplePresenter.share.<anonymous closure> (package:example/presenter/example_presenter.dart:80:19)
E/flutter (10823): #4      _rootRunUnary (dart:async/zone.dart:1132:38)
E/flutter (10823): #5      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (10823): #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (10823): #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
E/flutter (10823): #8      _DelayedData.perform (dart:async/stream_impl.dart:591:14)
E/flutter (10823): #9      _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
E/flutter (10823): #10     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:667:7)
E/flutter (10823): #11     _rootRun (dart:async/zone.dart:1120:38)
E/flutter (10823): #12     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (10823): #13     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter (10823): #14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter (10823): #15     _rootRun (dart:async/zone.dart:1124:13)
E/flutter (10823): #16     _CustomZone.run (dart:async/zone.dart:1021:19)
E/flutter (10823): #17     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
E/flutter (10823): #18     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
E/flutter (10823): #19     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
E/flutter (10823): #20     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

@zhouteng0217
Copy link
Owner

@crazecoder 老哥,中国人吧,中文交流啦。
上面的log的场景,我没又复现出来,不过发现了一些和它相关的问题,我发布了1.0.7版本,请引入下1.0.7版本后,测试看看,有什么结果再反馈下,多谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more information Need more information
Projects
None yet
Development

No branches or pull requests

2 participants