実現したいこと
androidmanifestsでmetadataの記述をして、アプリがクラッシュしないようにしたい
前提
kotlinを使ってアプリ開発を勉強しています。初心者です。アプリを実行すると、エミュレーターが起動した瞬間にクラッシュします。エラーの原因を調べると、manifestsファイルのmetadataというところを正しく記述すると治るのではないかと思われます。(初心者なので一応そこにたどり着きましたが、本当にそれが原因かはわかりません)ところが、metadataはアプリごとに記述が違うみたいで、何を書いたらいいのか全く分かりません。エラーメッセージは横にスクロールしてください
発生している問題・エラーメッセージ
E FATAL EXCEPTION: main Process: com.example.memoapp, PID: 25917 java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: ****************************************************************************** * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers * * should follow the instructions here: * * https://googlemobileadssdk.page.link/admob-android-update-manifest * * to add a valid App ID inside the AndroidManifest. * * Google Ad Manager publishers should follow instructions here: * * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. * ****************************************************************************** at android.app.ActivityThread.installProvider(ActivityThread.java:7427) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6939) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6710) at android.app.ActivityThread.access$1500(ActivityThread.java:247) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: java.lang.IllegalStateException: ****************************************************************************** * The Google Mobile Ads SDK was initialized incorrectly. AdMob publishers * * should follow the instructions here: * * https://googlemobileadssdk.page.link/admob-android-update-manifest * * to add a valid App ID inside the AndroidManifest. * * Google Ad Manager publishers should follow instructions here: * * https://googlemobileadssdk.page.link/ad-manager-android-update-manifest. * ****************************************************************************** at com.google.android.gms.ads.internal.client.zzef.attachInfo(com.google.android.gms:play-services-ads-lite@@21.0.0:20) at com.google.android.gms.ads.MobileAdsInitProvider.attachInfo(com.google.android.gms:play-services-ads-lite@@21.0.0:1) at android.app.ActivityThread.installProvider(ActivityThread.java:7422) ... 11 more
該当のソースコード
ソースコード
試したこと
metadataは現在記述していない状態です。
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。