React-native-firebase: 馃敟 [Question] How to remove AdMob SDK

Created on 6 May 2020  路  21Comments  路  Source: invertase/react-native-firebase

Issue

Hi,
I want to remove Advertising SDK from my android app.

I'm using Firebase SDK and Analytics in the app.

On Google Play Market Console I have a warning that the app uses Advertising SDK.
To check it I run this command in android folder

gradle app:dependencies

to check dependency tree. In console output I have something like that

+--- com.google.firebase:firebase-core:16.0.9
|    \--- com.google.firebase:firebase-analytics:16.5.0
|         +--- com.google.android.gms:play-services-measurement:16.5.0
|         |    ...other dependencies
|         |    +--- com.google.android.gms:play-services-measurement-impl:[16.5.0] -> 16.5.0
|         |    |    +--- com.google.android.gms:play-services-ads-identifier:16.0.0

I'm not a very good user of gradle, but as I understand, firebase-core have firebase-analytics dependency, which have play-services-measurement and so on and finally have play-services-ads-identifier dependency.

So when I bundle the app, I also have play-services-ads-identifier in my app. I think it can be the reason why Google Market believes that I use Advertising SDK

So my question is it possible to remove Advertising SDK and left only Core and Analytics?

Project files

package.json dependencies:

"dependencies": {
    ...
    "react": "16.8.6",
    "react-native": "0.59.10",
    "react-native-firebase": "5.5.4",
    ...

android/build.gradle


buildscript {
    ext {
        googlePlayServicesVersion = "16.1.0" // default: "+"
        firebaseVersion = "15.0.2" // default: "+"
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'io.fabric.tools:gradle:1.+'
        classpath 'com.google.gms:google-services:+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

android/app/build.gradle

dependencies {
    ...
    implementation project(':react-native-firebase')
    ...
    compile('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
      transitive = true;
    }
    // Firebase dependencies
    implementation('com.google.android.gms:play-services-basement:16.2.0')
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation "com.google.firebase:firebase-messaging:18.0.0"
}
apply plugin: 'com.google.gms.google-services'

Environment:

OS: macOS Mojave 10.14.4 (18E2034)
node: 12.16.2
npm: 6.14.4
Gradle: 5.5.1

Android AdMob Question Stale

Most helpful comment

Here is the warning I get in the Play Store console.

Ads

All 21 comments

We are facing the same issue. Any updates about that?

I think this needs to be directed more upstream at https://github.com/firebase/firebase-android-sdk/
I know they did work recently to have a 'CoreOnly' on the iOS side of things, to not drag in any advertising-related stuff, should be something similar on android side?

Hi @Tyki, hi @mikehardy
I wrote to Firebase Support and Google Support for Advertising SDK - they can't help with React Native apps.

For test purposes, I removed the firebase dependency and the warning has gone. So the problem was somewhere in the library.

Only solution for me was update React Native version to 0.62.2 (I suppose any version higher than 0.60 will fit too) and react-native-firebase to 6.7.1

I still have com.google.android.gms:play-services-ads-identifier:17.0.0 in Gradle dependencies, but the warning doesn't appear.

Now my project files look like this.

Project files


package.json

"dependencies": {
    ...
    "@react-native-firebase/analytics": "6.7.1",
    "@react-native-firebase/app": "6.7.1",
    "react-native": "0.62.2",
    ...

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.2")
        classpath 'com.google.gms:google-services:4.3.3' // Used for firebase SDK and push notifications
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

android/app/build.gradle

dependencies {
    ...
    implementation "com.google.firebase:firebase-messaging:20.1.7"
    ...
}

Hi @Tyki, hi @mikehardy
I wrote to Firebase Support and Google Support for Advertising SDK - they can't help with React Native apps.

So for their support you do need a minimal reproduction using just the native SDKs, yes

For test purposes, I removed the firebase dependency and the warning has gone. So the problem was somewhere in the library.

This is an assumption, it could have still been in their transitive dependency chain, which we necessarily depend on. And it may have just been older versions of their native libraries, as a possible alternative explanation

Only solution for me was update React Native version to 0.62.2 (I suppose any version higher than 0.60 will fit too) and react-native-firebase to 6.7.1

That version is still out of date, all the versions are 7+ now, definitely worth keeping current as the 6.x versions are on older native firebase SDKs so you're still running pretty old code

3575 in particular might interest you and is present in v7+ only per the tags on the merged commit https://github.com/invertase/react-native-firebase/commit/35285f1655b16d05e6630fc556f95cccfb707ee4

I still have com.google.android.gms:play-services-ads-identifier:17.0.0 in Gradle dependencies, but the warning doesn't appear.

I'm running RNFBv7+ with the firebase native packages overridden to be most current (25.4.1 right now) and I still have 17.0.0 on that dep though, so that seems pretty current

So you may have some tidying to do, but in general this seems resolved?

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

Sorry to write on a closed ticket, let me know if I have to proceed differently...but I have the same warning.

My package.json related to this library states:

"@react-native-firebase/analytics": "^7.1.3", "@react-native-firebase/app": "^7.2.0", "@react-native-firebase/crashlytics": "^7.1.4", "@react-native-firebase/dynamic-links": "^7.1.3", "@react-native-firebase/iid": "^7.1.3", "@react-native-firebase/in-app-messaging": "^7.1.3", "@react-native-firebase/messaging": "^7.1.4", "@react-native-firebase/perf": "^7.1.3",

and ./gradlew app:dependencies has these items:

com.google.firebase:firebase-analytics:17.4.3 | +--- com.google.android.gms:play-services-measurement:17.4.3 | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*) | | +--- com.google.android.gms:play-services-basement:17.0.0 (*) | | +--- com.google.android.gms:play-services-measurement-base:[17.4.3] -> 17.4.3 | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*) | | +--- com.google.android.gms:play-services-measurement-impl:[17.4.3] -> 17.4.3 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*) | | | +--- com.google.android.gms:play-services-ads-identifier:17.0.0 | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*) | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*) | | | +--- com.google.android.gms:play-services-measurement-base:[17.4.3] -> 17.4.3 (*) | | | \--- com.google.android.gms:play-services-stats:17.0.0 (*) | | \--- com.google.android.gms:play-services-stats:17.0.0 (*)

(Please note the com.google.android.gms:play-services-ads-identifier:17.0.0).

No idea if this can be related to the warning message.

Another interesting question to ask is: does this Google warning affects the rank/position in the Store (according to your experience)?

Thanks.

Why is this issue closed? it is not yet resolved.

Hi guys. This issue is closed because the solution was found - updating React Native version. It was a hard task, but it helped me.

Unfortunately, I have no info on why the issue exists in React Native < v0.60.0

Looks like this issue is not resolved. Google Play displays AdMob warning with these versions:

  • react-native 0.63.2
  • @react-native-firebase/app 8.3.1
  • @react-native-firebase/firestore 7.5.3
  • @react-native-firebase/remote-config 8.1.3

create a minimal reproduction and post it to firebase-android-sdk repo I think, @iqqmuT - or a minimal reproduction here with an ./gradlew :app:dependencies output from the android folder that shows the admob SDK coming in and from where

It's the same dependency chain as @IYarosh mentioned in the 1st post:

+--- project :react-native-firebase_app
|    +--- com.google.firebase:firebase-core -> 17.4.3
|    |    \--- com.google.firebase:firebase-analytics:17.4.3
|    |         +--- com.google.android.gms:play-services-measurement:17.4.3
|    |         |    +--- com.google.android.gms:play-services-measurement-impl:17.4.3
|    |         |    |    +--- com.google.android.gms:play-services-ads-identifier:17.0.0

play-services-ads-identifier is the only ads related library in the dependencies, so I would also guess that is the one which brings AdMob SDK.

If that is the case, I just don't understand why play-services-measurement-impl has a dependency on play-services-ads-identifier. But yes, this is a wrong forum to talk about that issue.

Worth noting you are on old versions, you might investigate why your firebase-android-sdk BOM is out of date, I'm getting 17.5.0 versions for most of that stack, but it otherwise looks similar

I believe the play-services-ads-identifier is different from the ads sdk

It is interesting that the original reporter stated this:

I still have com.google.android.gms:play-services-ads-identifier:17.0.0 in Gradle dependencies, but the warning doesn't appear.

That indicates to me that it is (or was?) possible to have the ads identifier in your dependencies without getting any warning.

I have ads-identifier in my dependencies, and I receive no such warning in my project on the play console. If someone could post exactly what this warning is, along with any supporting material linked to the warning, that could help.

Here is the warning I get in the Play Store console.

Ads

For clarity: Version: 30202 is the version code of the app, not of AdMob SDK.

Hello @paour

I know that you have issue with react native sdk, My answer is related to native one, if react-native sdk providers follow these steps at their end, he can release react native sdk without these warning. I have follow all steps mentioned in below link and I don't have a warning from google now.

https://stackoverflow.com/a/64798971/1252275

Its for information only, Hope it will help others.

This issue is definitely not resolved. We have "react-native": "0.63.2" and "@react-native-firebase/app": "^8.4.1" and still see the warning

We are on v10.1.0 now, you don't specify the version of the firebase-ios-sdk you are using (v7.1.0 is current) or firebase-android-sdk (26.1.0 is current), and you don't mention if you have any other modules included @EugeneDGE - in short, not a great issue report, I can't take any action on it. Upgrade to current, attempt to reproduce, and if you do please file a new issue following the template - we can take a look

Currently am using the latest version still i have the same problem
"react": "16.8.6",
"react-native": "0.60.6",

"@react-native-firebase/analytics": "^10.1.1",
"@react-native-firebase/app": "^10.1.0",
"@react-native-firebase/crashlytics": "^10.1.1",
"@react-native-firebase/in-app-messaging": "^10.1.1",
"@react-native-firebase/messaging": "^10.1.1",
"@react-native-firebase/perf": "^10.1.1",

We found ad SDKs in your app
Version: 33, SDK: AdMob
Version: 33, SDK: AdMob
Version: 33, SDK: AdMob

Please note @usuf16 that part of the initial issue template here is a full Podfile. In this case a Podfile.lock could even help, though I can say:

  • you are not up to date, we are on 10.2.0 :-) (we always have new versions, and this is actually unimportant, but just letting you know)
  • why are you on react-native 0.60.x? 0.63.x is current, use 'upgrade-helper' to update, these are easy updates compared to 0.59 to 0.60!
  • you may need to update your google admobs sdk with a pod repo update && pod update

It should work. This area of issues is stale at this point, everyone has gotten their apps approved and moved on I think, so it should be possible. I'm never sure why a specific project isn't working but I know it's possible with react-native-firebase

Please note @usuf16 that part of the initial issue template here is a full Podfile. In this case a Podfile.lock could even help, though I can say:

  • you are not up to date, we are on 10.2.0 :-) (we always have new versions, and this is actually unimportant, but just letting you know)
  • why are you on react-native 0.60.x? 0.63.x is current, use 'upgrade-helper' to update, these are easy updates compared to 0.59 to 0.60!
  • you may need to update your google admobs sdk with a pod repo update && pod update

It should work. This area of issues is stale at this point, everyone has gotten their apps approved and moved on I think, so it should be possible. I'm never sure why a specific project isn't working but I know it's possible with react-native-firebase

@mikehardy Thanks!! am agree with your commands that am not using react-native latest version

My question is that just i need a clarification on @react-native-firebase/admob": "^10.1.1" am not using this plugin in the app but still its highlighted that admob present in current uploaded app.

Reference i found in "index.android.bundle"

APP_NATIVE_MODULE='RNFBAppModule';e.DEFAULT_APP_NAME='[DEFAULT]';e.KNOWN_NAMESPACES=['admob','auth','analytics','remoteConfig','crashlytics','database','inAppMessaging','firestore','functions','iid','indexing','storage','dynamicLinks','messaging','naturalLanguage','ml','notifications','perf','utils']},556,[]);

You're not using inAppMessaging either, but that's in the KNOWN_NAMESPACES because it is a KNOWN_NAMESPACE to react-native-firebase. Means nothing more, don't overthink that.

Check your Podfile.lock for google-mobile-ads-sdk, and in the tree of dependencies encoded in Podfile.lock why it's coming in.

The full issue template (which you have not filled in and or provided info for) would have shown if you were overriding the firebase-ios-sdk anywhere. 7.3.0 is current, you should use that. Or at worst, if you update to react-native-firebase 10.2.0 you'll get firebase-ios-sdk 7.2.0

Either way, there is not an issue with react-native-firebase. Your project may have something wrong, but I can't say what. I won't be able to provide further support

Was this page helpful?
0 / 5 - 0 ratings