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 read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference #33

Closed
slhaos opened this issue Apr 17, 2020 · 7 comments

Comments

@slhaos
Copy link

slhaos commented Apr 17, 2020

Failed to handle method call
E/MethodChannel#com.zt.shareextend/share_extend(32332): java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Parcel.readException(Parcel.java:1960)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Parcel.readException(Parcel.java:1900)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.content.pm.IPackageManager$Stub$Proxy.queryIntentActivities(IPackageManager.java:3621)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ApplicationPackageManager.queryIntentActivitiesAsUser(ApplicationPackageManager.java:944)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ApplicationPackageManager.queryIntentActivities(ApplicationPackageManager.java:933)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareUtils.grantUriPermission(ShareUtils.java:34)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareExtendPlugin.share(ShareExtendPlugin.java:109)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.zt.shareextend.ShareExtendPlugin.onMethodCall(ShareExtendPlugin.java:61)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.MessageQueue.next(MessageQueue.java:379)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.os.Looper.loop(Looper.java:144)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at android.app.ActivityThread.main(ActivityThread.java:7529)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
E/MethodChannel#com.zt.shareextend/share_extend(32332): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
W/InputMethodManager(32332): startInputReason = 1
E/flutter (32332): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.ComponentInfo.applicationInfo' on a null object reference, null)
E/flutter (32332): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (32332): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (32332):
E/flutter (32332): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (32332): #3 ShareExtend._shareInner (package:share_extend/share_extend.dart:62:21)
E/flutter (32332): #4 ShareExtend.share (package:share_extend/share_extend.dart:34:12)
E/flutter (32332): #5 _MyAppState.build. (package:share_extend_example/main.dart:49:35)
E/flutter (32332):
E/flutter (32332): #6 _MyAppState.build. (package:share_extend_example/main.dart)
E/flutter (32332): #7 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:772:19)
E/flutter (32332): #8 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:855:36)
E/flutter (32332): #9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (32332): #10 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter (32332): #11 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter (32332): #12 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
E/flutter (32332): #13 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter (32332): #14 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter (32332): #15 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter (32332): #16 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (32332): #17 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter (32332): #18 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter (32332): #19 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (32332): #20 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (32332): #21 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (32332): #22 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (32332): #23 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (32332): #24 _rootRunUnary (dart:async/zone.dart:1196:13)
E/flutter (32332): #25 _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (32332): #26 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (32332): #27 _invoke1 (dart:ui/hooks.dart:275:10)
E/flutter (32332): #28 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)

折腾一天了也没有成功希望作者能协助一下,在安卓的手机上

@zhouteng0217
Copy link
Owner

@slhaos ,兄弟,你这个发生在哪个手机,哪个系统版本上?demo上的例子跑的有问题吗?

@zhouteng0217
Copy link
Owner

@slhaos 你这个问题出现的有点奇怪,你可以先执行下flutter clean,将工程clean下,再运行试试,再解决不了的话,可以提供下手机型号和系统版本号,还好都是中国人,好交流,太困了,我先睡了

@Slhaos7373
Copy link

我就是在demo 在华为荣耀8
安卓 8.0系统 运行在最新的flutter 就是4月7号发布的版本上,打算今天再折腾一天的

@Slhaos7373
Copy link

flutter clean 很多次了

@zhouteng0217
Copy link
Owner

@Slhaos7373 有qq吧,加我qq,1210514049, qq上可以发截图,录屏之类的,方便交流

@erzipl
Copy link

erzipl commented Apr 21, 2020

不好意思 这两天重装了一下环境,有空吗

@springlord888
Copy link

所以这个问题最终是解决了吗?

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

No branches or pull requests

5 participants