PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null) in flutter
PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null) in flutter
我正在尝试使用 local_auth package of flutter i used same example given that package here it is 添加 Figureprint 身份验证。
我收到这个错误
I/flutter (27676): PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null)
我试过了solution但问题是我不知道kotlin.
这是我的Mainactivity.kt
package com.example.bio_met
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
我找到了答案并且对我有用。这里只是将您的代码替换为 MainActivity.kt 文件中的以下代码。
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);
}
}
at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(Unknown Source:90)
at it.wytex.vibeland_client.MainActivity.l(Unknown Source:5)
at io.flutter.embedding.android.i.l(Unknown Source:10)
at io.flutter.embedding.android.e.k(Unknown Source:58)
at io.flutter.embedding.android.i.x0(Unknown Source:10)
at androidx.fragment.app.Fragment.c1(Unknown Source:21)
at androidx.fragment.app.j.R0(Unknown Source:433)
at androidx.fragment.app.o.b(Unknown Source:206)
at androidx.fragment.app.o.c(Unknown Source:18)
at androidx.fragment.app.o.C(Unknown Source:36)
at androidx.fragment.app.j.n0(Unknown Source:110)
at androidx.fragment.app.j.Z0(Unknown Source:88)
at androidx.fragment.app.j.l0(Unknown Source:21)
at androidx.fragment.app.j.e0(Unknown Source:9)
at androidx.fragment.app.j.y(Unknown Source:6)
at androidx.fragment.app.f.c(Unknown Source:4)
at androidx.fragment.app.d.onStart(Unknown Source:15)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
at android.app.Activity.performStart(Activity.java:7923)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3332)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)```
我正在尝试使用 local_auth package of flutter i used same example given that package here it is 添加 Figureprint 身份验证。 我收到这个错误
I/flutter (27676): PlatformException(no_fragment_activity, local_auth plugin requires activity to be a FragmentActivity., null)
我试过了solution但问题是我不知道kotlin.
这是我的Mainactivity.kt
package com.example.bio_met
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
我找到了答案并且对我有用。这里只是将您的代码替换为 MainActivity.kt 文件中的以下代码。
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);
}
}
at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(Unknown Source:90)
at it.wytex.vibeland_client.MainActivity.l(Unknown Source:5)
at io.flutter.embedding.android.i.l(Unknown Source:10)
at io.flutter.embedding.android.e.k(Unknown Source:58)
at io.flutter.embedding.android.i.x0(Unknown Source:10)
at androidx.fragment.app.Fragment.c1(Unknown Source:21)
at androidx.fragment.app.j.R0(Unknown Source:433)
at androidx.fragment.app.o.b(Unknown Source:206)
at androidx.fragment.app.o.c(Unknown Source:18)
at androidx.fragment.app.o.C(Unknown Source:36)
at androidx.fragment.app.j.n0(Unknown Source:110)
at androidx.fragment.app.j.Z0(Unknown Source:88)
at androidx.fragment.app.j.l0(Unknown Source:21)
at androidx.fragment.app.j.e0(Unknown Source:9)
at androidx.fragment.app.j.y(Unknown Source:6)
at androidx.fragment.app.f.c(Unknown Source:4)
at androidx.fragment.app.d.onStart(Unknown Source:15)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
at android.app.Activity.performStart(Activity.java:7923)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3332)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7562)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)```