我注意到我的项目中出现了新的 lint 问题。
长话短说:
我需要在我的自定义类中使用 BuildContext
flutter lint 工具与 aysnc 方法一起使用时并不满意。
例子:
MyCustomClass{
final buildContext context;
const MyCustomClass({required this.context});
myAsyncMethod() async {
await someFuture();
# if (!mounted) return; << has no effect even if i pass state to constructor
Navigator.of(context).pop(); # << example
}
}
Run Code Online (Sandbox Code Playgroud) dart flutter flutter-dependencies flutter-state flutter-build
在 Google Play 中发布应用程序后,我注意到Google Play 开发者控制台/移动 Pixel 5 上的预发布报告中存在一个崩溃问题。
App是使用Flutter框架构建的。
请指导我解决这个问题。
FATAL EXCEPTION: [com.google.android.gms.chimera.GmsIntentOperationService$ChimeraService-Executor] idle
Process: com.google.android.gms, PID: 2823
java.lang.IllegalArgumentException: Component class com.google.android.gms.wallet.ocr.CardRecognitionShimProxyActivity does not exist in com.google.android.gms
at android.os.Parcel.createExceptionOrNull(Parcel.java:2377)
at android.os.Parcel.createException(Parcel.java:2357)
at android.os.Parcel.readException(Parcel.java:2340)
at android.os.Parcel.readException(Parcel.java:2282)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:6793)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:2714)
at m.bfw.j(:com.google.android.gms.policy_payments@213380802@213380802065.395552306.395552306:2)
at com.google.android.gms.wallet.common.ModuleInitializer.b(:com.google.android.gms.policy_payments@213380802@213380802065.395552306.395552306:2)
at m.apa.onHandleIntent(:com.google.android.gms.policy_payments@213380802@213380802065.395552306.395552306:6)
at com.google.android.chimera.IntentOperation.onHandleIntent(:com.google.android.gms@213017046@21.30.17 (150400-395706864):2)
at sfq.onHandleIntent(:com.google.android.gms@213017046@21.30.17 (150400-395706864):4)
at eka.run(:com.google.android.gms@213017046@21.30.17 (150400-395706864):5)
at ejz.run(:com.google.android.gms@213017046@21.30.17 (150400-395706864):11)
at bwof.run(:com.google.android.gms@213017046@21.30.17 (150400-395706864):2)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.pm.PackageManagerService.setEnabledSetting(PackageManagerService.java:21135) …Run Code Online (Sandbox Code Playgroud) android google-play-services google-play-developer-api flutter google-play-console