react-native-admob icon indicating copy to clipboard operation
react-native-admob copied to clipboard

Ads not loading on React Native v0.19.0 for Android

Open danleveille opened this issue 10 years ago • 14 comments

I have this successfully working in iOS, but I can't figure out how to get it working for Android.

Could the readme be updated to include how/where to install the Google AdMob Framework for Android?

I followed the Android instructions on the readme, but I think I'm missing the Google AdMob Framework.

I'm a newbie with React Native Android, so I'm a little lost.

danleveille avatar Jan 28 '16 04:01 danleveille

The reason why there are no instructions how to add the AdMob library on Android is that it's not needed. The gradle will do that automatically.

Can you give me more information? Are there any errors or is the banner simply not showing? Which rn version are you using?

On 28.01.2016, at 05:33, Dan Leveille [email protected] wrote:

I have this successfully working in iOS, but I can't figure out how to get it working for Android.

Could the readme be updated to include how/where to install the Google AdMob Framework for Android?

I followed the Android instructions on the readme, but I think I'm missing the Google AdMob Framework.

I'm a newbie with React Native Android, so I'm a little lost.

— Reply to this email directly or view it on GitHub.

sbugert avatar Jan 28 '16 11:01 sbugert

@sbugert Oh, that's great to hear. Strangely enough, the interstitial works fine. The <RNBanner> component is rendering, it's just not displaying anything at all. I tried debugging by doing a console.log on onDidFailToReceiveAdWithError() and every other function of RNBanner, but none of the functions are called.

I'm on v0.19.0-rc of RN -- I'm guessing that might be the problem (I wanted to upgrade because I needed PickerAndroid).

danleveille avatar Jan 28 '16 21:01 danleveille

I tried different react-native versions and it still works on v0.18.0, but stops working on v0.19.0 (released yesterday).

So I assume that something between the two versions broke it but I still have not figured out what exactly.

sbugert avatar Jan 31 '16 12:01 sbugert

@sbugert Thanks for the update. Wish I could be more help, but unfortunately it's a bit over my head. :disappointed:

danleveille avatar Feb 01 '16 01:02 danleveille

any update on this? switched to 0.19 and nothings working on (im on android too)

jacob-russo avatar Feb 02 '16 10:02 jacob-russo

@jacob-russo we are actively working on this lib and will fix the issue soon(-ish). However, we are currently in the middle of another project. We'll keep you updated.

dkolba avatar Feb 02 '16 23:02 dkolba

Could this be related to react-native/issues/5304 and react-native/issues/5655?

I see the package referenced in this error:

(...)
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.facebook.react.views.recyclerview.RecyclerViewBackedScrollViewManager
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
W/unknown:ViewManagerPropertyUpdater( 5084): Could not find generated setter for class com.sbugert.rnadmob.RNAdMobBannerViewManager

Trying to figure out the issue here but I have little to no Java experience. Ads are the only thing holding up my Android launch, so I'm trying my best. Haha.

danleveille avatar Feb 05 '16 06:02 danleveille

Looks like it could be related. However, the proposed fixes did not change anything for me. Have you also tried them? Maybe it's something else.

I haven't tried v0.20.0-rc yet, maybe there's a fix. I will try it tonight.

sbugert avatar Feb 06 '16 11:02 sbugert

@sbugert Just tested v0.20.0-rc. Same thing -- interstitials work, but banners do not.

danleveille avatar Feb 07 '16 00:02 danleveille

You need to update the imports to import com.facebook.react.uimanager.annotations.ReactProp; for the ReactProps to work on 0.19+

cosmith avatar Feb 09 '16 13:02 cosmith

@cosmith Thank you so much, that is it! I couldn't import it first so I had to additionally update the gradle build file of the module (which still used rn 0.13).

@jacob-russo and @danleveille I will publish the working version later, good luck for your Android launch!

sbugert avatar Feb 09 '16 14:02 sbugert

I love rubber duck debugging <3

dkolba avatar Feb 09 '16 14:02 dkolba

it seems cause by progurad in v0.19 in the debug mode it works,but release it shows the log "Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager ;Could xxx ..."

yipengmu avatar Feb 17 '16 08:02 yipengmu

Could be related to https://github.com/facebook/react-native/issues/5818. Can you try the suggested fix in this issue and tell me if it worked?

sbugert avatar Feb 17 '16 16:02 sbugert