Open AndrewBotalov80 opened 3 years ago
Found some error
`E/MethodChannel#flutter/platform_views(30986): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.content.Context.isUiContext()' on a null object reference
E/MethodChannel#flutter/platform_views(30986): at android.view.ViewConfiguration.get(ViewConfiguration.java:507)
E/MethodChannel#flutter/platform_views(30986): at android.view.View.<init>(View.java:5356)
E/MethodChannel#flutter/platform_views(30986): at android.view.View.<init>(View.java:5518)
E/MethodChannel#flutter/platform_views(30986): at android.view.ViewGroup.<init>(ViewGroup.java:708)
E/MethodChannel#flutter/platform_views(30986): at android.view.ViewGroup.<init>(ViewGroup.java:704)
E/MethodChannel#flutter/platform_views(30986): at android.view.ViewGroup.<init>(ViewGroup.java:700)
E/MethodChannel#flutter/platform_views(30986): at android.view.ViewGroup.<init>(ViewGroup.java:696)
E/MethodChannel#flutter/platform_views(30986): at com.journeyapps.barcodescanner.CameraPreview.<init>(CameraPreview.java:228)
E/MethodChannel#flutter/platform_views(30986): at com.journeyapps.barcodescanner.BarcodeView.<init>(BarcodeView.java:76)
E/MethodChannel#flutter/platform_views(30986): at net.touchcapture.qr.flutterqr.QRView.initBarCodeView(QRView.kt:201)
E/MethodChannel#flutter/platform_views(30986): at net.touchcapture.qr.flutterqr.QRView.getView(QRView.kt:196)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:189)
E/MethodChannel#flutter/platform_views(30986): at android.app.Dialog.dispatchOnCreate(Dialog.java:419)
E/MethodChannel#flutter/platform_views(30986): at android.app.Dialog.show(Dialog.java:313)
E/MethodChannel#flutter/platform_views(30986): at android.app.Presentation.show(Presentation.java:257)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.plugin.platform.VirtualDisplayController.<init>(VirtualDisplayController.java:95)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:207)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:104)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#flutter/platform_views(30986): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#flutter/platform_views(30986): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#flutter/platform_views(30986): at android.os.MessageQueue.next(MessageQueue.java:335)
E/MethodChannel#flutter/platform_views(30986): at android.os.Looper.loop(Looper.java:183)
E/MethodChannel#flutter/platform_views(30986): at android.app.ActivityThread.main(ActivityThread.java:8010)
E/MethodChannel#flutter/platform_views(30986): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#flutter/platform_views(30986): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
E/MethodChannel#flutter/platform_views(30986): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
yes, I also get an error message like that, after I restart the application using the FlutterRestart.restartApp()
method, then immediately open the QR Scanner.
How to reproduce:
We can skip step 2 and not open QR scan before, anyway after NFC scan and returning to app we will have grey screen.
If we scan NFC in foreground everything is OK.
Screenshots: Step 2. Step 5.
Video: https://user-images.githubusercontent.com/18752756/120157065-0db08380-c20c-11eb-8059-8b7a0b31b100.mp4
Flutter information flutter doctor -v
Device (please complete the following information):
Additional context pubspec.yaml:
Found error after debug:
My project code: