flutter_barcode_scanner icon indicating copy to clipboard operation
flutter_barcode_scanner copied to clipboard

FlutterFragmentActivity support issue

Open suchul opened this issue 5 years ago • 10 comments

This feature is not supported for FlutterFragmentActivity on Android. I would like to ask if this feature is supported.

suchul avatar Nov 26 '19 00:11 suchul

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.

asa-odoo avatar Dec 18 '19 13:12 asa-odoo

App is getting crashed during launch If i implement FlutterFragmentActivity to my App's MainActivity.

sdevamit avatar May 15 '20 15:05 sdevamit

@sdevamit Can you provide some error logs?

AmolGangadhare avatar May 15 '20 15:05 AmolGangadhare

@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.

sdevamit avatar May 18 '20 09:05 sdevamit

@AmolGangadhare Did you able to figure out what is problem here with fragment activity?

sdevamit avatar May 19 '20 21:05 sdevamit

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.

AmolGangadhare avatar Dec 21 '20 20:12 AmolGangadhare

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

gushendra86 avatar Jan 07 '21 10:01 gushendra86

I have added support.

This plugin now works great with the official local_auth plugin from the flutter team :heart:

TylerByte666 avatar Jan 28 '21 07:01 TylerByte666

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.

alejandroPolak-1 avatar Jul 14 '21 20:07 alejandroPolak-1

@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?

a371057600 avatar Apr 09 '22 06:04 a371057600