Home > Mobile >  React Native firebase admob not installing, How can I install without crashing the app
React Native firebase admob not installing, How can I install without crashing the app

Time:08-13

Here below is the error I am getting I used this command npm i @react-native-firebase/admob my project name- AwesomeProjec559911

C:\Users\Admin\Desktop\ReactNative\Firebase\AwesomeProjec559911>npm i @react-native-firebase/admob
            npm ERR! code ERESOLVE
            npm ERR! ERESOLVE unable to resolve dependency tree
            npm ERR!
            npm ERR! While resolving: [email protected]
            npm ERR! Found: @react-native-firebase/[email protected]
            npm ERR! node_modules/@react-native-firebase/app
            npm ERR!   @react-native-firebase/app@"^15.3.0" from the root project
            npm ERR!
            npm ERR! Could not resolve dependency:
            npm ERR! peer @react-native-firebase/app@"11.5.0" from @react-native-firebase/[email protected]
            npm ERR! node_modules/@react-native-firebase/admob
            npm ERR!   @react-native-firebase/admob@"*" from the root project
            npm ERR!
            npm ERR! Fix the upstream dependency conflict, or retry
            npm ERR! this command with --force, or --legacy-peer-deps
            npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
            npm ERR!
            npm ERR! See C:\Users\Admin\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
            npm ERR!     C:\Users\Admin\AppData\Local\npm-cache\_logs\2022-08-12T05_42_55_770Z-debug-0.log

my package.json file

"dependencies": {
            "@react-native-firebase/app": "^15.3.0",
            "@react-native-firebase/firestore": "^15.3.0",
            "react": "18.0.0",
            "react-native": "0.69.4"
          },

got this New error, previous error solved.after installing npm add react-native-google-mobile-ads, I got this error

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\Admin\Desktop\ReactNative\Firebase\hellworldfirebaseeekkl\node_modules\react-native-google-mobile-ads\android\build.gradle' line: 75

* What went wrong:
A problem occurred evaluating project ':react-native-google-mobile-ads'.
> Cannot get property 'googleMobileAdsJson' on extra properties extension as it does not exist

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-google-mobile-ads'.
> compileSdkVersion is not specified. Please add it to build.gradle

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

CodePudding user response:

@react-native-firebase/admob package has been deprecated.

You have to use react-native-google-mobile-ads package instead.

  • Related