invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
686 stars 139 forks source link

[🐛] Interstitial Ad, AppOpen Ad not working after build. #203

Closed ahmadeyamin closed 2 years ago

ahmadeyamin commented 2 years ago

All ads is working fine in the emulator before build. But when I build the app "Interstitial Ad, AppOpen Ad" both types of ads does not work anymore.

This is what shows in Play Console Error Log.

io.invertase.googlemobileads.ReactNativeGoogleMobileAdsAdHelper.setFullScreenContentCallback
java.lang.NoSuchMethodException

package.json:

"react-native-google-mobile-ads": "^7.0.1",
ahmadeyamin commented 2 years ago

I got the solution.

This is because of proguard

add this to proguard-rules.pro

-keep class com.google.android.gms.internal.consent_sdk.** { *; }
-keep class com.google.android.gms.ads.** { *; }
-keep class io.invertase.googlemobileads.** { *; }