Open peterlauri opened 4 years ago
@daadu did you test to build and use the plugin after this PR https://github.com/bcko/flutter_qrcode_reader/pull/57?
Yes, it is working for me.
@daadu is there any other permission than android.permission.CAMERA needed for this plugin to work?
@daadu after the commit https://github.com/bcko/flutter_qrcode_reader/commit/a34c10c3a471ad0e2083a6205369e89a41639e17 the app builds and launches, the scanner also launches, but now crashes on scan. No errors...
@daadu after the commit a34c10c the app builds and launches, the scanner also launches, but now crashes on scan. No errors...
This one was my commit. So just to clarify, before my commit the plugin was crashing on startup, but after if you are able to launch, just cannot scan?
Unsure what the issue is, but some questions: Did you place the camera permission in the correct part of the android manifest, and is it spelt correctly? What does Logcat say? Is your app using FlutterFragmentActivity (that is what my fix intended to address). Any other native code changes in your app?
@lfwells
Actually, so the camera preview shows up, but crashes as soon as it finds a QR code it crashes. Same code works fine on iOS.
I'm don't know if the app uses FlutterFragmentActivity, I'm using a basic startup project, with no additional changes than added qrcode_reader@a34c10c to the pubspec.yaml
I'm not using Android Studio, just running it from VScode. Do not have Logcat enabled.
This is my full debug AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_poc">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
</manifest>
hi @peterlauri i had the same error. I modified que line 141 in the class QRCodeReaderPlugin in my local repo. if (requestCode == REQUEST_CODE_SCAN_ACTIVITY ) to if (requestCode == REQUEST_CODE_SCAN_ACTIVITY && pendingResult != null)
Might the comment https://github.com/bcko/flutter_qrcode_reader/issues/61#issuecomment-586739940 be a valid solution?
@aegislp submit a PR?
Same issue for me. Just adding it to my app in pubspec.yaml crashes the app on Android simulator immediately after boot. iOS simulator has no issues.
@aegislp can you please push this fix?
@peterlauri or maybe you can do the fix and push it? I'm reliant on this package, would be greatly appreciated.
Dit you get the pubspec.yaml to get the plugin as:
qrcode_reader: git: https://github.com/bcko/flutter_qrcode_reader.git
I can not publish to pub.dev unfortunately.
Had the same issue, adding the .git package worked for me. 4 days trying to solve this crap! Thanks for the fix.
Just by simply adding the package the Android version crashes on startup. iOS works perfectly in debug and released version. We are not refering to the qrcode_reader anywhere in our code. We have android.permission.CAMERA in uses.permissions. Removing the package from pubspec.yaml gets the app going on Android again.
Flutter doctor.