'admob causes expo app to crash in production

I built my app using expo I am using admob to include banner ads and interstitial ads. Everything works fine during the development but once I put the app on google play and download it crashes. I checked the logcat and I am getting this error:

java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.IllegalStateException:

I have added the googleMobileAdsAppId here is my json config

{
  "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"
    }
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source