0

I'm openning the scanner of qr_code_scanner plugin and getting a white screen and this error:

E/MethodChannel#flutter/platform_views(27605): Failed to handle method call E/MethodChannel#flutter/platform_views(27605): java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference E/MethodChannel#flutter/platform_views(27605): at android.view.ViewConfiguration.get(ViewConfiguration.java:521) E/MethodChannel#flutter/platform_views(27605): at android.view.View.(View.java:5216) E/MethodChannel#flutter/platform_views(27605): at android.view.View.(View.java:5358) E/MethodChannel#flutter/platform_views(27605): at android.view.ViewGroup.(ViewGroup.java:709) E/MethodChannel#flutter/platform_views(27605): at android.view.ViewGroup.(ViewGroup.java:705) E/MethodChannel#flutter/platform_views(27605): at android.view.ViewGroup.(ViewGroup.java:701) E/MethodChannel#flutter/platform_views(27605): at android.view.ViewGroup.(ViewGroup.java:697) E/MethodChannel#flutter/platform_views(27605): at com.journeyapps.barcodescanner.CameraPreview.(CameraPreview.java:228) E/MethodChannel#flutter/platform_views(27605): at com.journeyapps.barcodescanner.BarcodeView.(BarcodeView.java:76) E/MethodChannel#flutter/platform_views(27605): at net.touchcapture.qr.flutterqr.CustomFramingRectBarcodeView.(CustomFramingRectBarcodeView.kt:12) E/MethodChannel#flutter/platform_views(27605): at net.touchcapture.qr.flutterqr.QRView.initBarCodeView(QRView.kt:197) E/MethodChannel#flutter/platform_views(27605): at net.touchcapture.qr.flutterqr.QRView.getView(QRView.kt:191) E/MethodChannel#flutter/platform_views(27605): at io.flutter.plugin.platform.SingleViewPresentation.onCreate(SingleViewPresentation.java:188) E/MethodChannel#flutter/platform_views(27605): at android.app.Dialog.dispatchOnCreate(Dialog.java:874) E/MethodChannel#flutter/platform_views(27605): at android.app.Dialog.show(Dialog.java:521) E/MethodChannel#flutter/platform_views(27605): at android.app.Presentation.show(Presentation.java:257) E/MethodChannel#flutter/platform_views(27605): at io.flutter.plugin.platform.VirtualDisplayController.(VirtualDisplayController.java:95) E/MethodChannel#flutter/platform_views(27605): at io.flutter.plugin.platform.VirtualDisplayController.create(VirtualDisplayController.java:48) E/MethodChannel#flutter/platform_views(27605): at io.flutter.plugin.platform.PlatformViewsController$1.createVirtualDisplayForPlatformView(PlatformViewsController.java:214) E/MethodChannel#flutter/platform_views(27605): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.create(PlatformViewsChannel.java:107) E/MethodChannel#flutter/platform_views(27605): at io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$1.onMethodCall(PlatformViewsChannel.java:59) E/MethodChannel#flutter/platform_views(27605): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) E/MethodChannel#flutter/platform_views(27605): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:296) E/MethodChannel#flutter/platform_views(27605): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:320) E/MethodChannel#flutter/platform_views(27605): at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$TsixYUB5E6FpKhMtCSQVHKE89gQ.run(Unknown Source:12) E/MethodChannel#flutter/platform_views(27605): at android.os.Handler.handleCallback(Handler.java:900) E/MethodChannel#flutter/platform_views(27605): at android.os.Handler.dispatchMessage(Handler.java:103) E/MethodChannel#flutter/platform_views(27605): at android.os.Looper.loop(Looper.java:219) E/MethodChannel#flutter/platform_views(27605): at android.app.ActivityThread.main(ActivityThread.java:8668) E/MethodChannel#flutter/platform_views(27605): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#flutter/platform_views(27605): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) E/MethodChannel#flutter/platform_views(27605): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

flutter doctor: image

  • Check one time both android & iOS platform integration required steps added correctly, and then flutter clean, flutter pub get & uninstall app & re-install it again. – Vishal Zaveri Aug 30 '22 at 01:30
  • The integration is added correctly, the problem occurs when I start a flutter activity as the flutter documentation says, here -> https://docs.flutter.dev/development/add-to-app/android/add-flutter-screen Once I do that, the white screen appears, but if I dont do that, everything work correctly – Rodrigo Reveron Aug 31 '22 at 02:04

0 Answers0