flutter_barcode_scanner
flutter_barcode_scanner copied to clipboard
FlutterFragmentActivity support issue
This feature is not supported for FlutterFragmentActivity on Android. I would like to ask if this feature is supported.
Same issue. not able to run application after new update in flutter. Issue is like MainActivity is not able to cast FlutterActivity from java file.
App is getting crashed during launch If i implement FlutterFragmentActivity to my App's MainActivity.
@sdevamit Can you provide some error logs?
@sdevamit Can you provide some error logs?
these are the logs i am getting :
Launching lib\main.dart on POCO F1 in debug mode... Running Gradle task 'assembleDebug'... √ Built build\app\outputs\apk\debug\app-debug.apk.
i changed my main activity as below :
import androidx.annotation.NonNull
//import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
i am using local_auth plugin which requires to implement FlutterFragmentActivity in main activity and after i used flutter_barcode_scanner the problem started to come.
@AmolGangadhare Did you able to figure out what is problem here with fragment activity?
I was not able to reproduce this issue. Please try upgrading the flutter to latest stable version and then try using the plugin.
If possible please update if it resolves the issue for you.
Hello, the plugin is very great.
The issue is solved here https://github.com/AmolGangadhare/flutter_barcode_scanner/issues/128
But it is using manual replace of FlutterActivity to FlutterFragmentActivity. If we generated it from fresh source code, the issue is still remain
I have this issue when using it with https://pub.dev/packages/local_auth And local_auth plugin must use FlutterFragmentActivity
In flutter_barcode_scanner path D:\flutter.pub-cache\hosted\pub.dartlang.org\flutter_barcode_scanner-1.0.2\android\src\main\java\com\amolg\flutterbarcodescanner\FlutterBarcodeScannerPlugin.java is using FlutterActivity instead of FlutterFragmentActivity.
So we need to choose to resolved it with manual replace or choose 1 between flutter_barcode_scanner or local_auth, hope this can help the other
Thank you and kind regards
I have added support.
This plugin now works great with the official local_auth plugin from the flutter team :heart:
Hola, el complemento es muy bueno.
El problema se resuelve aquí # 128
Pero está usando el reemplazo manual de FlutterActivity a FlutterFragmentActivity. Si lo generamos a partir de un código fuente nuevo, el problema sigue siendo
Tengo este problema cuando lo uso con https://pub.dev/packages/local_auth Y el complemento local_auth debe usar FlutterFragmentActivity
En flutter_barcode_scanner ruta D: \ flutter.pub-cache \ hospedado \ pub.dartlang.org \ flutter_barcode_scanner-1.0.2 \ android \ src \ main \ java \ com \ amolg \ flutterbarcodescanner \ FlutterBarcodeScannerPlugin.java está usando FlutterActivity.
Por lo tanto, debemos elegir resolverlo con reemplazo manual o elegir 1 entre flutter_barcode_scanner o local_auth, espero que esto pueda ayudar al otro
gracias y saludos cordiales
Hola, el complemento es muy bueno.
El problema se resuelve aquí # 128
Pero está usando el reemplazo manual de FlutterActivity a FlutterFragmentActivity. Si lo generamos a partir de un código fuente nuevo, el problema sigue siendo
Tengo este problema cuando lo uso con https://pub.dev/packages/local_auth Y el complemento local_auth debe usar FlutterFragmentActivity
En flutter_barcode_scanner ruta D: \ flutter.pub-cache \ hospedado \ pub.dartlang.org \ flutter_barcode_scanner-1.0.2 \ android \ src \ main \ java \ com \ amolg \ flutterbarcodescanner \ FlutterBarcodeScannerPlugin.java está usando FlutterActivity.
Por lo tanto, debemos elegir resolverlo con reemplazo manual o elegir 1 entre flutter_barcode_scanner o local_auth, espero que esto pueda ayudar al otro
gracias y saludos cordiales
Excelent! Thank you!
I was able to manually fix the problem with local_auth. In the new package update, maybe it could be changed from FlutterActivity to FlutterFragmentActivity.
@sdevamit Can you provide some error logs?
these are the logs i am getting :
Launching lib\main.dart on POCO F1 in debug mode... Running Gradle task 'assembleDebug'... √ Built build\app\outputs\apk\debug\app-debug.apk.
i changed my main activity as below :
import androidx.annotation.NonNull //import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine import io.flutter.plugins.GeneratedPluginRegistrant class MainActivity: FlutterFragmentActivity() { override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { GeneratedPluginRegistrant.registerWith(flutterEngine); } }
i am using local_auth plugin which requires to implement FlutterFragmentActivity in main activity and after i used flutter_barcode_scanner the problem started to come.
I have exactly the same problem as you. Can I fix it by removing this plug-in?