Closed alvaro1728 closed 5 years ago
Same problem. It seems all ad types(banner, interstitial, rewarded) fail. Is there anybody who confirms V6 Admob works?
"dependencies": { "@react-native-firebase/admob": "^6.0.0", "@react-native-firebase/app": "^6.0.0", "react": "16.9.0", "react-native": "0.61.1" }
AdMob is tricky to properly test, however it has all been working from our local tests.
Can you delete your Podfile.lock
and run a pod install --repo-update
to ensure all of the files for the project are being imported.
This file works on both Android & iOS: https://github.com/invertase/react-native-firebase/blob/master/tests/app.admob.js#L109
I can confirm that it's been fixed with 6.0.0. Thanks!
I'm getting the same error message on my Android build and I'm using 6.0.1 - anyone know of a solution?
Same issue in android test:
"@react-native-firebase/admob": "^6.0.2", "@react-native-firebase/app": "^6.0.2", "react-native": "0.61.2",
import { BannerAd, BannerAdSize, TestIds } from '@react-native-firebase/admob';
<BannerAd unitId={TestIds.BANNER} size={BannerAdSize.BANNER} request={{}} onAdLoaded={() => console.log('loaded')} onAdFailedToLoad={e => console.log('failed to load', e)} />
Solution update: MainApplication.java
old version:
import com.facebook.react.shell.MainReactPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNFirebasePackage(),
);
new version:
import com.facebook.react.PackageList;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
return packages;
}
Work fine!
I have the same error on android
anyone find the solution need help..
I solve it in android by 1- upgrade all react native firebase packages
2- clean android build
cd android && gradlew clean
3- reinstall app in android emulator
yarn android
anyone solve this???????????????????
@Hassan-Hmc use https://github.com/invertase/react-native-google-ads - admob is no longer a part of firebase upstream or here, the code has been extracted and lives in that repo now
My dependencies:
My code:
The run-time error:
Unhandled JS Exception: Invariant Violation: requireNativeComponent: "ReactNativeFirebaseAdMobBannerView" was not found in the UIManager.
This error is located at: in ReactNativeFirebaseAdMobBannerView (at BannerAd.js:90) in BannerAd (at App.js:51) in RCTView (at View.js:35) in View (at App.js:39) in App (at renderApplication.js:40) in RCTView (at View.js:35) in View (at AppContainer.js:98) in RCTView (at View.js:35) in View (at AppContainer.js:115) in AppContainer (at renderApplication.js:39)
Thanks, Alvaro