【发布时间】:2022-08-07 22:15:25
【问题描述】:
我使用 expo 构建了我的应用程序,我正在使用 admob 来包含横幅广告和插页式广告。在开发过程中一切正常,但是一旦我将应用程序放在谷歌播放并下载它就会崩溃。我检查了logcat,我收到了这个错误:
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:
我添加了 googleMobileAdsAppId 这是我的 json 配置
{
\"expo\": {
\"name\": \"App Name\",
\"slug\": \"App-Name\",
\"version\": \"2.0.2\",
\"orientation\": \"portrait\",
\"icon\": \"./assets/icon.png\",
\"splash\": {
\"image\": \"./assets/splash.png\",
\"resizeMode\": \"contain\",
\"backgroundColor\": \"#ffffff\"
},
\"updates\": {
\"fallbackToCacheTimeout\": 0
},
\"assetBundlePatterns\": [
\"**/*\"
],
\"ios\": {
\"supportsTablet\": true,
\"config\": {
\"googleMobileAdsAppId\": \"Ca-app-pub-xxxxx\"
},
\"bundleIdentifier\": \"com.xxxxxx\",
\"buildNumber\": \"2.0.2\"
},
\"android\": {
\"adaptiveIcon\": {
\"foregroundImage\": \"./assets/adaptive-icon.png\",
\"backgroundColor\": \"#FFFFFF\"
},
\"config\": {
\"googleMobileAdsAppId\": \"Ca-app-pub-xxxx\"
},
\"package\": \"com.xxxxxx\",
\"versionCode\": 6,
\"permissions\":[]
},
\"web\": {
\"favicon\": \"./assets/favicon.png\"
}
}
}
标签: crash expo admob logcat production