@@ -74,29 +74,28 @@ project.ext {
7474
7575apply from : file(" ./app-json.gradle" )
7676
77- def isManagedExpoProject = ! rootProject. file(" android" ). exists() && ! rootProject. file(" ios" ). exists()
7877def appJSONGoogleMobileAdsAppIDString = " "
7978def appJSONGoogleMobileAdsDelayAppMeasurementInitBool = false
8079def appJSONGoogleMobileAdsOptimizeInitializationBool = true
8180def appJSONGoogleMobileAdsOptimizeAdLoadingBool = true
8281
83- if (rootProject. ext. has(" googleMobileAdsJson" )) {
82+ if (rootProject. ext. has(" googleMobileAdsJson" ) && rootProject . ext . googleMobileAdsJson ) {
8483 appJSONGoogleMobileAdsAppIDString = rootProject. ext. googleMobileAdsJson. getStringValue(" android_app_id" , " " )
8584 appJSONGoogleMobileAdsDelayAppMeasurementInitBool = rootProject. ext. googleMobileAdsJson. isFlagEnabled(" delay_app_measurement_init" , false )
8685 appJSONGoogleMobileAdsOptimizeInitializationBool = rootProject. ext. googleMobileAdsJson. isFlagEnabled(" optimize_initialization" , true )
8786 appJSONGoogleMobileAdsOptimizeAdLoadingBool = rootProject. ext. googleMobileAdsJson. isFlagEnabled(" optimize_ad_loading" , true )
8887}
8988
90- if (! appJSONGoogleMobileAdsAppIDString && ! isManagedExpoProject ) {
89+ if (! appJSONGoogleMobileAdsAppIDString) {
9190 println " \n\n\n "
9291 println " **************************************************************************************************************"
9392 println " \n\n\n "
94- println " ERROR: react-native-google-mobile-ads requires an 'android_app_id' property inside a 'react-native-google-mobile-ads' key in your app.json."
95- println " No android_app_id property was found in this location. The native Google Mobile Ads SDK will crash on startup without it."
93+ println " WARNING: react-native-google-mobile-ads requires an 'android_app_id' property inside a 'react-native-google-mobile-ads' key in your app.json."
94+ println " No android_app_id property was found in this location. The native Google Mobile Ads SDK will crash on startup without it."
95+ println " You can safely ignore this warning if you are using our Expo config plugin."
9696 println " \n\n\n "
9797 println " **************************************************************************************************************"
9898 println " \n\n\n "
99- System . exit(1 )
10099}
101100
102101android {
0 commit comments