我正在开发一个应用程序 flutter 。我正在尝试将方法通道从颤振调用到 Android
当。。。的时候var accountToken=await platform.invokeMethod("ccAvenuePayment", {"params": jsonEncode(payment.toJson())});
我在日志中遇到崩溃并且应用程序关闭
java.lang.NoSuchMethodError: No virtual method getSavedStateRegistry()Landroidx/savedstate/SavedStateRegistry; in class Landroidx/appcompat/app/AppCompatActivity; or its super classes (declaration of 'androidx.appcompat.app.AppCompatActivity' appears in /data/app/~~kpJG3PwxxqPGEm-YvsB4dA==/ae.ehail.rider_ios2-wdmI__mnIKJeTtbATI_naw==/base.apk)
E/AndroidRuntime(29070): at androidx.appcompat.app.AppCompatActivity.initDelegate(AppCompatActivity.java:116)
E/AndroidRuntime(29070): at androidx.appcompat.app.AppCompatActivity.<init>(AppCompatActivity.java:95)
E/AndroidRuntime(29070): at mumbai.dev.testapp.MainActivity.<init>(MainActivity.java:34)
E/AndroidRuntime(29070): at java.lang.Class.newInstance(Native Method)
E/AndroidRuntime(29070): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
E/AndroidRuntime(29070): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
E/AndroidRuntime(29070): at android.app.Instrumentation.newActivity(Instrumentation.java:1253)
E/AndroidRuntime(29070): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3353)
E/AndroidRuntime(29070): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
E/AndroidRuntime(29070): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
E/AndroidRuntime(29070): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(29070): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(29070): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime(29070): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(29070): at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime(29070): at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime(29070): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(29070): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime(29070): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process (29070): Sending signal. PID: 29070 SIG: 9
我无法弄清楚这个问题。根本没有调用方法通道。
我搜索了互联网,但可以找到这个错误No virtual method getSavedStateRegistry()
这是我的代码
https://gist.github.com/RageshAntony/93f77677cb69720616254fc710dd7832
请帮我