PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null) in flutter
1,097
I Found the answer and it worked for me. Here it is just replace your code with following code in MainActivity.kt file.
package //your package name for eg.com.example.filename
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);
}
}
Author by
ReX
Updated on December 20, 2022Comments
-
ReX over 1 year
I am trying add Figureprint authentication using local_auth package of flutter i used same example given that package here it is. And i am getting this error
I/flutter (27676): PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null)
I have try this solution But the problem is that I don't know about kotlin.
Here is my Mainactivity.kt
package com.example.bio_met import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { }
-
Tizi Dev over 3 yearsthis code works if I run on Emulator but if I build APK for my Android the Application crash at starting
-
ReX over 3 years@TiziDev can show me logs while it's crashing. you see the logs in the android studio logcat tab on the bottom while running the app connect your phone to the system to see logs.
-
Tizi Dev over 3 yearsBelow I have posted the Log from Note Pro 9 Xiamei, the application crash after installing APK
-
ReX about 3 yearsSorry but I can't understand what is happing but you can open an issue on the GitHub repo of "Flutter" there you will get help or search on issues selection there for same error if anyone already solved.