Closed angelobdev closed 7 months ago
I was having the same issue, but this was what worked for me. I am using app.config.ts and changed
export default { expo: expoConfig, 'react-native-google-mobile-ads': reactNativeGoogleMobileAds };
to
module.exports = { expo: expoConfig, 'react-native-google-mobile-ads': reactNativeGoogleMobileAds };
I'm a react-native-cli project, not expo, but I'd like to share how I solved this issue. I wanted to share how I solved my "Cannot get property 'googleMobileAdsJson' on extra properties extension as it does not exist" error.
When I added enabled, test_mode entry inside app.json file in root directory, it built successfully. Hope this helps.
// project/app.json
{
"name": "",
"displayName": "",
"react-native-google-mobile-ads": {
"android_app_id": "",
"ios_app_id": "",
"user_tracking_usage_description": "",
"enabled": true, // <= add this
"test_mode": true, // <= add this
"sk_ad_network_items": [
"cstr6suwn9.skadnetwork",
"4fzdc2evr5.skadnetwork",
"4pfyvq9l8r.skadnetwork",
"2fnua5tdw4.skadnetwork",
"ydx93a7ass.skadnetwork",
"5a6flpkh64.skadnetwork",
"p78axxw29g.skadnetwork",
"v72qych5uu.skadnetwork",
"ludvb6z3bs.skadnetwork",
"cp8zw746q7.skadnetwork",
"3sh42y64q3.skadnetwork",
"c6k4g5qg8m.skadnetwork",
"s39g8k73mm.skadnetwork",
"3qy4746246.skadnetwork",
"f38h382jlk.skadnetwork",
"hs6bdukanm.skadnetwork",
"v4nxqhlyqp.skadnetwork",
"wzmmz9fp6w.skadnetwork",
"yclnxrl5pm.skadnetwork",
"t38b2kh725.skadnetwork",
"7ug5zh24hu.skadnetwork",
"gta9lk7p23.skadnetwork",
"vutu7akeur.skadnetwork",
"y5ghdn5j9k.skadnetwork",
"n6fk4nfna4.skadnetwork",
"v9wttpbfk9.skadnetwork",
"n38lu8286q.skadnetwork",
"47vhws6wlr.skadnetwork",
"kbd757ywx3.skadnetwork",
"9t245vhmpl.skadnetwork",
"eh6m2bh4zr.skadnetwork",
"a2p9lx4jpn.skadnetwork",
"22mmun2rn5.skadnetwork",
"4468km3ulz.skadnetwork",
"2u9pt9hc89.skadnetwork",
"8s468mfl3y.skadnetwork",
"klf5c3l5u5.skadnetwork",
"ppxm28t8ap.skadnetwork",
"ecpz2srf59.skadnetwork",
"uw77j35x4d.skadnetwork",
"pwa73g5rt2.skadnetwork",
"mlmmfzh3r3.skadnetwork",
"578prtvx9j.skadnetwork",
"4dzt52r2t5.skadnetwork",
"e5fvkxwrpn.skadnetwork",
"8c4e2ghe7u.skadnetwork",
"zq492l623r.skadnetwork",
"3rd42ekr43.skadnetwork",
"3qcr597p9d.skadnetwork"
]
}
}
tried a lot of stuff but the issue persist after upgrading to expo 50, building on expo 48 still working.
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
@netronicus
tried a lot of stuff but the issue persist after upgrading to expo 50, building on expo 48 still working.
any update or solution?
How it's currently implemented, you can't skip using "app.json" or "app.config.js", they're hardcoded. I solved it by forking the repository (and using it as package.json dependency). Instead of the hardcoded "app.json" I'm using the "admob.json" file. Having "app.json" and "app.config.ts" in the same place didn't seem clean.
Here's the problematic part https://github.com/amarjanica/react-native-google-mobile-ads/commit/bd99fadd601648c958e3181d6594ebae9da4638e https://github.com/amarjanica/react-native-google-mobile-ads/commit/738cf9abcfad4bdd73f65b184748f3e202806772 (replaced app.json with admob.json)
I can build the apk, I'm using expo 51, I'm yet to test my solution 100% works.
It would be better if the library didn't depend on a hardcoded configuration file, or add support for "app.config.ts"
Help services are no longer operational. This meta employee Marie_consultancy was recommended to me. My account was quickly restored by her. She can be reached on Instagram at MARIE_CONSULTANCY and by mail at MARIECONSULTANCY
I ran into this exact solution using expo 51 i spent a few hours tracking this down, hope this helps someone as this was my first google result
if you watch the logs expo 51+ removes the react native google mobile ads: [RUN_GRADLEW] Warning: Root-level "expo" object found. Ignoring extra key in Expo config: "react-native-google-mobile-ads" [RUN_GRADLEW] Learn more: https://expo.fyi/root-expo-object
ll you have to do is remove the expo tag from app.json (yes i know the current older guides say the opposite)
{
- "expo": { ################ REMOVE THIS LINE ############
"name": "beta",
"icon": "./icon.png",
"plugins": [
["expo-router", { }]
]
- } ############### AND THIS ONE #####################
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxx~xxxxxxx",
"ios_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx"
}
}
My builds started working just fine after this... hope this helps someone!
What happened?
I'm building a mobile app and I want to configure the Ads... On iOS everything works fine but when I try to run it on android it gives me this error.
Output of "npx expo run:android":
Platforms
Only 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