Closed mavericdesigner closed 4 years ago
Thanks for the details, I'll try to reproduce / fix the issue today. useCamera=-1 means "Use the default camera". This equals the behaviour pre 3.0.0
I'm also facing the same issue, camera opens.. after scanning the QR, it doesn't returns the result. Behaviour is same on android and ios. barcode_scan version 3.0.3 Regards,
Same issue here, no errors, it just scans the code but exits back to the app without any result v3.0.0, previous version 2.0.2 works fine.
I can't reproduce the problem. I compiled the example App as release and tested it both on iOS 13 and Android 9. @mavericdesigner: PDF 417 Is recognized really slow but I didn't find the reason for that. @rpandey91: The current version is 3.0.0
Can anyone reproduce the problem with the example app in this repo?
Android: Same problem, but when using the example app everything works. I already faced the same problem in 3.0.0-dev.3 (maybe this helps)
Logcat:
D/ViewRootImpl(15318): ViewPostImeInputStage ACTION_DOWN I/Timeline(15318): Timeline: Activity_launch_request id:de.devvillage.abipay time:1191053 D/PhoneWindow(15318): *FMB* installDecor mIsFloating : false D/PhoneWindow(15318): *FMB* installDecor flags : -2139029248 D/PhoneWindow(15318): *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null D/PhoneWindow(15318): *FMB* isFloatingMenuEnabled return false D/mali_winsys(15318): new_window_surface returns 0x3000, [480x800]-format:1 I/Timeline(15318): Timeline: Activity_idle id: android.os.BinderProxy@2df06e8e time:1191436 V/ActivityThread(15318): updateVisibility : ActivityRecord{2b5c8608 token=android.os.BinderProxy@12c9dfab {de.devvillage.abipay/de.devvillage.abipay.MainActivity}} show : false D/mali_winsys(15318): new_window_surface returns 0x3000, [480x800]-format:1 D/mali_winsys(15318): new_window_surface returns 0x3000, [480x800]-format:1 D/mali_winsys(15318): new_window_surface returns 0x3000, [480x800]-format:1 I/Timeline(15318): Timeline: Activity_idle id: android.os.BinderProxy@12c9dfab time:1195454 D/InputMethodManager(15318): windowDismissed mLockisused = false
Hi
Resolving this after Replacing the Plugin Registry with FlutterEngine
Deleting the GeneratedPluginRegistrant.java under android->app>src->main->java->io->flutter->plugins
Add meta-data flutterEmbedding at AndroidManifest.xml
<meta-data android:name="flutterEmbedding" android:value="2" />
at the end of the file according a fresh flutter project.
Works fine now !
3. Migrating from version 2.0.2 to 3.0.0 doesn't work..
Resolving this after Replacing the Plugin Registry with FlutterEngine
1. Deleting the GeneratedPluginRegistrant.java under android->app>src->main->java->io->flutter->plugins 2. Add meta-data flutterEmbedding at AndroidManifest.xml
<meta-data android:name="flutterEmbedding" android:value="2" />
at the end of the file according a fresh flutter project.
throws error during build: e: /home/user/projects/abipay/android/app/src/main/kotlin/de/devvillage/abipay/MainActivity.kt: (11, 44): Type mismatch: inferred type is MainActivity but FlutterEngine was expected
Yes.. thats right .... sorry i forgot this ... Replace the default the MainActivity.kt at app->src->main->kotlin with the following code that, its the default code of a fresh project.
Don't forget to change the first line with your package name
` package com.replacethis.with.your.package
import androidx.annotation.NonNull; import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); } } `
@popcos sorry, but this throws e: /home/user/projects/abipay/android/app/src/main/kotlin/de/devvillage/abipay/MainActivity.kt: (9, 40): Unresolved reference: nonnull
Did you migrate to Android X ?
is there no other way?
is there no other way?
ask @devtronic
wait, actually i did migrate to androidX (sorry for that @popcos )
That's true, a new flutter app just works fine with the package. The problem is not the migration of barcode_reader itself, but an "old" flutter project with the 3.0.0 package version.
A newer flutter project is generated with what @popcos said:
<meta-data android:name="flutterEmbedding" android:value="2"/>
I had to configure Kotlin too, and I moved the MainActivity inside kotlin folder. The configuration needed was:
In app/build.gradle:
apply plugin: 'kotlin-android'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
inside dependenciesAnd in build.gradle:
ext.kotlin_version = "1.3.72"
inside buildscriptclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
on dependenciesWhat was all, it's working for me on Android. I don't know why this is necessary, and what to do on iOS.
Thanks for the help! I now just created a new app and copied all my files over. I guess it was the MainActivity.kt, heres the new one:
package
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() { }
..maybe this helps others
Can anyone provide an example project in which the problem exists?
According to https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects Old Flutter projects need to be upgrade in order your be compatible with the plugin.
@popcos thanks for the link. I'll update the upgrade guide.
We are currently experience an issue where the Barcode isn't actually scanned. The scanner seems not to detect the barcode. I've debugged the code up to
useCamera=-1 unless I force it in the options:
I don't know if it is part of the issue.
My config is as follows:
barcode_scan version 3.0.0
Flutter 1.12.13+hotfix.9 • channel stable • https://github.com/flutter/flutter.git Framework • revision f139b11009 (3 weeks ago) • 2020-03-30 13:57:30 -0700 Engine • revision af51afceb8 Tools • Dart 2.7.2
We are building for iOS 13.2.
Test phones is iPhone 8 and iPhone X with latest iOS version.
It currently works flawlessly on our Android builds though *I've added the Privacy Permission for iOS
I've also added an example of a barcode we are trying to scan.
Please inform me if I'm doing something stupid.