我的应用程序在google_mobile_ads:^0.13.0软件包颤动时停止启动



在调试模式下在sdk gphone arm64上启动lib/main.art。。。正在运行Gradle任务"assemblyDebug"。。。✓内置版本/app/outputs/flutter apk/app-debug.apk。正在安装build/app/outputs/flutter apk/app.apk。。。E/AndroidRuntime(22444(:致命异常:mainE/AndroidRuntime(22444(:进程:com.n3t0l0b0.blogspot.mp.view.lite,PID:22444E/AndroidRuntime(22444(:java.lang.NoClassDefFoundError:解析失败:Lcom/google/android/gms/ads/RewardedVideoAdListenerE/AndroidRuntime(22444(:位于com.shatsy.admobflutter.AdmobFlutterPlugin。(未知来源:0(E/AndroidRuntime(22444(:位于com.shatsy.admobflutter.AdmobFlutterPlugin.registerWith(未知来源:0(E/AndroidRuntime(22444(:位于io.flutter.plugins.GeneratedPluginRegistration.registerWith(GeneratedPlugin Registration.java:18(E/AndroidRuntime(22444(:位于com.n3t0l0b0.blogspot.mpc.view.lite.MainActivity.configureFlutterEngine(MainActivity.kt:13(E/AndroidRuntime(22444(:位于io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAnd FragmentDelege.java:180(E/AndroidRuntime(22444(:在io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:409(E/AndroidRuntime(22444(:在android.app.Activity.performCreate(Activity.java:8000(E/AndroidRuntime(22444(:在android.app.Activity.performCreate(Activity.java:77984(E/AndroidRuntime(22444(:在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309(E/AndroidRuntime(22444(:在android.app.ActivityThread.performLaunchActivity(ActivityThreads.java:3422(E/AndroidRuntime(22444(:在android.app.ActivityThread.handleLaunchActivity(ActivityThreads.java:3601(E/AndroidRuntime(22444(:在android.app.servertransaction.LaunchActivityItem.exexecute(LaunchActivityItem.java:85(E/AndroidRuntime(22444(:在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135(E/AndroidRuntime(22444(:在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95(E/AndroidRuntime(22444(:在android.app.ActivityThread$H.handleMessage(ActivityThreads.java:2066(E/AndroidRuntime(22444(:在android.os.Handler.dispatchMessage(Handler.java:106(E/AndroidRuntime(22444(:在android.os.Looper.loop(Looper.java:223(E/AndroidRuntime(22444(:在android.app.ActivityThread.main(ActivityThreads.java:7656(E/AndroidRuntime(22444(:位于java.lang.reflect.Method.ioke(Native Method(E/AndroidRuntime(22444(:在com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592(E/AndroidRuntime(22444(:在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947(E/AndroidRuntime(22444(:由java.lang.ClassNotFoundException引起:未找到类";com.google.android.gms.ads.reward.RewardedVideoAdListener"在路径上:DexPathList[[zip文件"/data/app/~~a29NxUkt4Kiz-H0rHByzQw=.com/n3t0l0b0.blogspot.mpc.view.lite-P6AM1rmvTmJmN96iEUwOkQ==/base.apk"],nativeLibrary目录=[/data/app/~~a29NxUkt4Kiz-H0rHByzQw==com.n3t0l0b0.blogspot.mpc.view.lite-P65AM1rmvTmJmN96iEUwOkQ==/lib/arm64,/data/app/~a29NsUkt4Kiz-HrHByyzQw==com.n3t0l0b0.blogspop.mpc.view.lite-P65M1rmvTm JmN96 iEUwOKQ==/base.apk!/lib/arm64-v8a,/system/lib64,/system_ext/lib64]]E/AndroidRuntime(22444(:在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207(E/AndroidRuntime(22444(:在java.lang.ClassLoader.loadClass(ClassLoader.java:379(E/AndroidRuntime(22444(:在java.lang.ClassLoader.loadClass(ClassLoader.java:312(E/AndroidRuntime(22444(:。。。再21个连接到服务协议时出错:无法连接到http://127.0.0.1:64017/1GFjUO3RNRw=/

我找到了解决方案,我刚刚从我的pubspec.yaml 中删除了包admob_flutter:^1.0.1

它将通过添加正确的"AdMob应用程序ID";ApplicationManifest.xml文件中。下面给出的示例代码片段

<manifest>
<application>
<!-- Sample **AdMob App ID**: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
</application>
</manifest>

文件(https://pub.dev/packages/google_mobile_ads)明确提到";不正确的值将导致应用程序崩溃">

官方文件称";AdMob应用程序ID必须包含在AndroidManifest.xml中。否则将导致应用程序启动时崩溃">

相关内容

  • 没有找到相关文章