运行后不能调出相机
来源:6-15 拍照APP开发-拍照配置与AndroidX兼容处理【实战尝鲜】
Mecil9
2019-05-08
An Observatory debugger and profiler on Android SDK built for x86 is available at: http://127.0.0.1:55205/ZB3iAg7AP1Q=/
For a more detailed help message, press “h”. To detach, press “d”; to quit, press “q”.
E/MethodChannel#plugins.flutter.io/image_picker( 6490): Failed to handle method call
E/MethodChannel#plugins.flutter.io/image_picker( 6490): 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#plugins.flutter.io/image_picker( 6490): at androidx.core.content.FileProvider.parsePathStrategy(FileProvider.java:605)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at androidx.core.content.FileProvider.getPathStrategy(FileProvider.java:579)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:417)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at io.flutter.plugins.imagepicker.ImagePickerDelegateKaTeX parse error: Expected 'EOF', got '#' at position 78: …E/MethodChannel#̲plugins.flutter…IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/MethodChannel#plugins.flutter.io/image_picker( 6490): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/flutter ( 6490): [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 ( 6490): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter ( 6490): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter ( 6490):
E/flutter ( 6490): #2 ImagePicker.pickImage (package:image_picker/image_picker.dart:56:40)
E/flutter ( 6490):
E/flutter ( 6490): #3 _PhotoAppState.getImage (package:myapp/photo_app_page.dart:14:35)
E/flutter ( 6490):
E/flutter ( 6490): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter ( 6490): #5 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:566:30)
E/flutter ( 6490): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter ( 6490): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter ( 6490): #8 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:211:7)
E/flutter ( 6490): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 6490): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:225:20)
E/flutter ( 6490): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter ( 6490): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 6490): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 6490): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 6490): #15 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter ( 6490): #16 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 6490): #17 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter ( 6490): #18 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter ( 6490): #19 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
E/flutter ( 6490):
1回答
-
Mecil9
提问者
2019-05-08
ios,运行正常,Android是否因为X的配置问题,我的开发环境为vscode,也按照教程进行了修改!
032019-05-17
相似问题