react-native-admob: Interstitial AD Broken at AdMob Update SDK 20
Not build npx react-native run-android
.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 9
- Comments: 33
Commits related to this issue
- fix Interstitial AD Broken at AdMob Update SDK 20 https://github.com/sbugert/react-native-admob/issues/560#issuecomment-813928127 — committed to Kunkka0822/react-native-admob by Kunkka0822 3 years ago
If you need to work around this problem, you can change the following row in the
build.gradle
file of the react-native-admob projectimplementation 'com.google.android.gms:play-services-ads:+'
toimplementation 'com.google.android.gms:play-services-ads:19.6.0'
.The changes the the SDK were made in version 19.7.0 and finalized in 20.0.0. This is not a long-term fix, though.
Same issue.
node_modules/react-native-admob/android/build.gradle
line 25
I was looking project’s own build.gradle file. Thanks 😃
This is currently an issue i’m facing and have lost a lot of hours to it.
Android Manifest
build.gradle (app) dependencies
build.gradle (project)
I followed the instructions to add it to my project. It builds in iOS but won’t build in Android. PLEASE HELP!
It was working on my first try but it doesn’t work anymore (“I applied my solution”)
If you need to do the workaround patch manually more than a couple of times, you might want to look into automating it with
patch-package
or creating your own fork. See: https://github.com/ds300/patch-packageI would not expect a permanent fix, as the library does not seem to be actively maintained anymore. Full migration to the v20 SDK seems to be a decent amount of work too. See: https://developers.google.com/admob/android/migration So if you do not want to take that route, you will probably need to look for alternative libraries.
This row wasn’t included in my project. Although I added, nothing has changed
That error is because maybe the admob account is not ready yet and it doesn’t have ads right now. I recommend you move this convo to the other package’ repo (@react-native-admob/admob) or to an specific forum to avoid spamming this thread.
Ese error es porque a lo mejor la cuenta de admob aun no está lista y no tiene anuncios por ahora. Te recomiendo mover esta conversación al otro repo del package (@react-native-admob/admob) o a un foro específico para evitar spamear este hilo
Saludos 👋
@fernandoVicentei I just switched to this package, maybe you should try it.
I started to work on new package https://www.npmjs.com/package/@react-native-admob/admob because this package seems to not maintained any more. My package supports new SDK and also support interstitial and rewarded with react hook.
I needed to do some extra steps:
node_modules/react-native-admob/android/build.gradle
implementation 'com.google.android.gms:play-services-ads:19.6.0'
npx patch-package react-native-admob
android/app/build.gradle
now you can run your app. Don’t forget to use a test id in the asUnitID prop like this
ca-app-pub-3940256099942544/6300978111
✌️It works for me with Rn version 0.63.4 but with version 0.64 my app does not open on my device, does anyone know why?