React-native-admob: What about androidx migration ?

Created on 18 Jun 2019  路  9Comments  路  Source: sbugert/react-native-admob

Recently you can't compile anymore due to googles androidx update : https://github.com/facebook/react-native/issues/25294
When do you think it will be done ?

Most helpful comment

It's working now :) thx
For maintaining purposes when packages seems to be abandoned, i do that :

  1. Fork this package
  2. Fix the problem on my fork and push
  3. Modify my package.json like that : "react-native-admob": "git+https://[email protected]/grean/react-native-admob",
  4. yarn upgrade react-native-admob

All 9 comments

@grean I guess this lib has been abandoned long ago, I'm trying to switch to firebase admob...

What I did was change dependency in build.gradle of react-native-admob to
compile 'com.google.android.gms:play-services-ads:17.2.1'
but that's obviously just a hot fix and I guess we should move on from this package...

It's working now :) thx
For maintaining purposes when packages seems to be abandoned, i do that :

  1. Fork this package
  2. Fix the problem on my fork and push
  3. Modify my package.json like that : "react-native-admob": "git+https://[email protected]/grean/react-native-admob",
  4. yarn upgrade react-native-admob

switching to firebase with ADmob took around 2 and half hours. The main difference is that firebase doesn't return a promise to wait for when you request an AD. for the rest is pretty much the same.

it looks like the repo is not maintained anymore I have forked the project and added support for android X.

just add this in package json "react-native-admob":"git+https://github.com/MTTenterprise/react-native-admob"

and you should be good to go

it looks like the repo is not maintained anymore I have forked the project and added support for android X.

just add this in package json "react-native-admob":"git+https://github.com/MTTenterprise/react-native-admob"

and you should be good to go

Hi @MTTenterprise, is there anything else I need to do? I'm getting an error with this line when I run it in the iPhone simulator:

import {AdMobBanner} from 'react-native-admob';
Invariant Violation: requireNativeComponent: "RNGADBannerView" was not found in the UIManager.

This error is located at:
    in RNGADBannerView (at RNAdMobBanner.js:51)
    in AdMobBanner (at AdBanner.js:19)
    in RCTView (at View.js:35)
    in View (at AdBanner.js:18)
    in AdBanner (at ShareDialog.js:117)
    in RCTView (at View.js:35)
    in View (at ShareDialog.js:114)
    ...

I've opened a PR to bring this library up to date with the latest version of React Native, and thus bringing support for CocoaPods and support for Android X: #472

The latest beta (v2.0.0-beta.6) should build fine with the latest version of React Native (and thus should support AndroidX).

Was this page helpful?
0 / 5 - 0 ratings