Open gwaelesadeo opened 3 years ago
Hello, I have added some logs in the plugin, into the file FlutterBarcodeScannerPlugin.java. This is the result : On fresh install (the boolean is the result of the test activity != null) E/FlutterBarcodeScannerPlugin( 9029): [GWA]: FlutterBarcodeScannerPlugin E/FlutterBarcodeScannerPlugin( 9029): [GWA]: onAttachedToActivity (true) E/FlutterBarcodeScannerPlugin( 9029): [GWA]: createPluginSetup (true) E/FlutterBarcodeScannerPlugin( 9029): [GWA]: FlutterBarcodeScannerPlugin E/FlutterBarcodeScannerPlugin( 9029): [GWA]: onAttachedToActivity (true) E/FlutterBarcodeScannerPlugin( 9029): [GWA]: createPluginSetup (true) E/FlutterBarcodeScannerPlugin( 9029): [GWA]: clearPluginSetup E/FlutterBarcodeScannerPlugin( 9029): [GWA]: startBarcodeScannerActivityView (false)
After restart : E/FlutterBarcodeScannerPlugin( 9245): [GWA]: FlutterBarcodeScannerPlugin E/FlutterBarcodeScannerPlugin( 9245): [GWA]: onAttachedToActivity (true) E/FlutterBarcodeScannerPlugin( 9245): [GWA]: createPluginSetup (true) E/FlutterBarcodeScannerPlugin( 9245): [GWA]: startBarcodeScannerActivityView (true)
I don't know why the activity is restarted. That should come from another plugin or my code. I will continue to investigate but if someone have an idea to help me he's welcome :) Thx
Describe the bug Hello, In my app, the FlutterBarcodeScanner.scanBarcode method is called when the user tap on a FAB. On a fresh install, the scanner screen is not displayed and I've got this message in the logs:
E/FlutterBarcodeScannerPlugin(15813): startView: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
I can tap several times on the FAB, I've got the same message each time. If I quit the app and relaunch it, all works fine, the scanner screen is displayed as expected. If I remove the app and reinstall it, I've got the bug again, only on the first launch just after the fresh install.To Reproduce Steps to reproduce the behavior:
Expected behavior I would the scanner library works on the first use just after a fresh install.
Smartphone (please complete the following information):
Additional context The library is really easy to use (thanks for that)