为什么在构建APK后我的Expo应用程序崩溃

时间:2020-07-29 03:16:21

标签: android react-native crash expo logcat

该应用无法打开 在更新代码并添加后: Admob + i18n-js本地化。 我认为它是本地化的,但我做对了,它在应用程序内的JSON是否有任何促销,例如wifi或类似的东西 我的app.json

{
  "expo": {
    "name": "vat 15%",
    "description": "Fastest tax Added Calculator 15%",
    "slug": "vatApp",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "version": "1.2.0",
    "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-ideletetThis"
      }
    },
    "android": {
      "package": "com.ideletetThis.ideletetThis",
      "versionCode": 2,
      "config": {
        "googleMobileAdsAppId": "ca-app-pub-i delete"
      }
    },
    "sdkVersion": "38.0.0"
  }
}

登录猫在APK上出现错误

 Process: com.myappname.ideletetThis, PID: 23538
    java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException: 
    
    ******************************************************************************
    * Invalid application ID. Follow instructions here: https:// goo . gl/fQ2neu to *
    * find your app ID.                                                          *
    ******************************************************************************
    

2 个答案:

答案 0 :(得分:0)

在Manifest.xml中添加以下元数据

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value=**appID**/>

答案 1 :(得分:0)

JSON文件

中添加Admob android键后已解决
 "android": {
      "package":"com.stackoverflow.vatApp",
      "versionCode": 2,
      "config": {
        "googleMobileAdsAppId":"ca-app-pub-349893000004~000000"
      }