【问题标题】:admob causes expo app to crash in productionadmob 导致 expo 应用程序在生产中崩溃
【发布时间】: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


    【解决方案1】:

    大佬,这个错误你解决了吗?我面临同样的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-21
      • 2016-06-04
      • 2011-08-24
      相关资源
      最近更新 更多