Getting this error while using local_auth version 0.6.0
It's working fine for iOS but getting this error in android.
Already have implemented class MainActivity: FlutterFragmentActivity()
but still getting this issue
This is what I did to solve this issue.
Change your MainActivity.kt
as below:
package com.[your.package]
import androidx.annotation.NonNull
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)
}
}
However, after changing this MainActivity.kt
, I also faced some other issue with the Theme.AppCompat
. Check this out https://gist.github.com/akifarhan/f70a2c777651f2ea61a15eb92a5939c1 for the solution.
change your main activity to override FlutterFragmentActivity
import android.os.Bundle
import io.flutter.app.FlutterFragmentActivity
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
}
}
if you are using flutter embedding version 2
import androidx.annotation.NonNull
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine:
FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine)
}
}
Flutter details
Flutter version 1.22.4 at /Users/macbookpro/Desktop/development/flutter
If you are using java then change your main activity to this
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.android.FlutterFragmentActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterFragmentActivity{
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With