Closed BrodaNoel closed 4 months ago
Is maybe EAS removing it?
Is this something related? https://github.com/expo/fyi/blob/main/root-expo-object.md#migrating-the-config
There were some changes in app.json
since SDK 51
@BrodaNoel
I'm having the same problem, do you have a solution for this?
@toadfansboy nop... not yet... I'mw waiting for some response here. My builds are totally blocked by this 🤷♂️
@toadfansboy have you found any workaround here? I still have my releases blocked because of this. I'm considering removing the Ads until it gets fixed.
Infortunately I'm thinking of doing the same thing as @BrodaNoel... Do you know which previous version would resolve this problem? 🤞
@maximebaudoin the only option would be to roll back to Expo SDK 50.
I am right now trying some workarounds for this. If I get some luck, I'll let your know
@maximebaudoin the only option would be to roll back to Expo SDK 50.
I am right now trying some workarounds for this. If I get some luck, I'll let your know
I don't know if I'm the only one, but with Expo SDK 50, I have the same problem. In fact, I have this problem from a minimum 1 or 2 months ago.
I just tried this, and it worked on iOS. I'm right now waiting for the Android build.
https://github.com/invertase/react-native-google-mobile-ads/pull/584
Right now, I'm duplicating all the configuration (react-native-google-mobile-ads
) in 2 places:
root > react-native-google-mobile-ads
key in the root of app.json
root > expo > extra > react-native-google-mobile-ads
in app.json
@BrodaNoel how about android build?
Your guide is not work in iOS(root and root > expo > extra)
@jb9229 but have you applied the patches from the PR as well?
You can implement "patch-package" (look for the NPM package).
You make the changes in node_modules and then run
'npx patch-package react-native-google-mobile-ads'
Then you need to as patch-package as a dependency in your package.json, and configure it to auto-run it post install.
Sorry I can't give more details. I'm away from the computer.
I tried many times, but I failed...; @BrodaNoel
@jb9229 are you also copying all the config inside root > expo > extra
?
The key should be something like:
root > expo > extra > react-native-google-mobile-ads > ios_app_id
yes, i did
@jb9229 you are on Expo SDK 51, right?
@BrodaNoel
definitly right
Look, it really seems like you have everything exactly like my configuration, so, double check if this isn't a cache problem
You have this dependency installed, right?
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0"
Check in the logs if after the yarn install
there is a text saying something like: "The patches were applied for package xxxx"
this is yarn install
@maximebaudoin the only option would be to roll back to Expo SDK 50.
Hi, I tried to go back to Expo@50.x.x but the problem was still present despite several hours of testing and deleting and reinstalling the node_modules.
You can implement "patch-package" (look for the NPM package).
You make the changes in node_modules and then run
'npx patch-package react-native-google-mobile-ads'
Then you need to as patch-package as a dependency in your package.json, and configure it to auto-run it post install.
Sorry I can't give more details. I'm away from the computer.
When I see your messages, I tested earlier by going back to Expo@51.x.x and applying the patch as explained above. And the error is still there.
I specify that I follow all the instructions to the letter and test by executing the npx expo run:ios
command.
Am I forgetting something glaring ? I don't know...
@jb9229 it's hard to tell from your screenshot but it looks like your "react-native-google-mobile-ads" key is outside of the "extra" key. It looks like you have something like:
"extra": {
},
"react-native-google-mobile-ads": {
}
instead of:
"extra": {
"react-native-google-mobile-ads": {
}
}
Can confirm that this patch, at least via manually updating ios_config.sh
, works as intended.
It seems to be inside extra 🤔
Why don't you try to build on EAS servers, instead of in your local? That's what I am doing
It seems to be inside extra 🤔
Why don't you try to build on EAS servers, instead of in your local? That's what I am doing
Apologies, I only saw the react-native-google-mobile-ads
object at the end of the screenshot, I overlooked the one inside extra
. I'm not using EAS, but local build on physical device is working for me for iOS. Thank you for your patch 👌
Are you guys having both app.json
and app.config.js
files?
If so, this might be the problem. PR #517 broke this case and PR #521 is supposed to fix it, but seems to come with more issued. In my projects I'm using the following patch (and apply it with patch-package
). It basically reverts the behaviour of PR #517 by only looking at the app.js
file.
diff --git a/node_modules/react-native-google-mobile-ads/ios_config.sh b/node_modules/react-native-google-mobile-ads/ios_config.sh
index b57451a..1df22c1 100755
--- a/node_modules/react-native-google-mobile-ads/ios_config.sh
+++ b/node_modules/react-native-google-mobile-ads/ios_config.sh
@@ -93,7 +93,7 @@ while true; do
echo "info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME}/${_JS_APP_CONFIG_FILE_NAME} file."
- _SEARCH_RESULT=$(find "$_CURRENT_SEARCH_DIR" -maxdepth 2 \( -name ${_JSON_FILE_NAME} -o -name ${_JS_APP_CONFIG_FILE_NAME} \) -print | /usr/bin/head -n 1)
+ _SEARCH_RESULT=$(find "$_CURRENT_SEARCH_DIR" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | /usr/bin/head -n 1)
if [[ "$(basename ${_SEARCH_RESULT})" = "${_JS_APP_CONFIG_FILE_NAME}" ]]; then
_IS_CONFIG_JS=true
I have an iOS and Android app, with root > expo > react-native-google-mobile-ads
, I'm able to build successfully for iOS with EAS and locally. The same app.json
fails for Android:
ERROR: react-native-google-mobile-ads requires an 'android_app_id' property inside a 'react-native-google-mobile-ads' key in your app.json.
No android_app_id property was found in this location. The native Google Mobile Ads SDK will crash on startup without it.
I've tried to include react-native-google-mobile-ads
in extra
or keep both inside and outside but isn't working for Android.
Last chance is patch-package
as suggested but I didn't had time to test it.
:tada: This issue has been resolved in version 14.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Does anyone have a fix for this, even after upgrading to the latest versions, I still can't build it "ios_app_id key not found in react-native-google-mobile-ads key in app.json. App will crash without it."
I have tried patch-package, I have verified the node_modules/react-native-google-mobile-ads/ios_config_sh code to make sure it's exactly like the fix shared by @mikehardy but still can't get the app to build. I have also added the "react-native-google-mobile-ads" key under extra with no success.
Thanks.
What happened?
I'm building using
eas build -p ios
, and I'm getting this error:Consider that this error is suddenly happening after I upgraded to Expo SDK 51.
Now, the weird thing is that I have, and I always had (it was working before) the
ios_app_id
in myapp.json
. Like this:Platforms
iOS, but have not tested behavior on Android
React Native Info
Are your using Typescript?
package.json
app.json
ios/Podfile
android/build.gradle
android/app/build.gradle
android/settings.gradle
AndroidManifest.xml