Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃敟 [Question] How to remove AdMob SDK #3617

Closed
IYarosh opened this issue May 6, 2020 · 29 comments
Closed

馃敟 [Question] How to remove AdMob SDK #3617

IYarosh opened this issue May 6, 2020 · 29 comments
Labels
platform: android plugin: admob Google AdMob Type: Question Type: Stale Issue has become stale - automatically added by Stale bot

Comments

@IYarosh
Copy link

IYarosh commented May 6, 2020

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

@IYarosh IYarosh changed the title 馃敟 [Question] How to remove AdMob SDK 馃敟 [Question] How to remove AdMob SDK May 6, 2020
@Tyki
Copy link

Tyki commented Jun 9, 2020

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

@mikehardy
Copy link
Collaborator

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?

@IYarosh
Copy link
Author

IYarosh commented Jun 9, 2020

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"
    ...
}

@mikehardy
Copy link
Collaborator

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 35285f1

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?

@stale
Copy link

stale bot commented Jul 11, 2020

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.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Jul 11, 2020
@IYarosh IYarosh closed this as completed Jul 13, 2020
@lorenzosfarra
Copy link

lorenzosfarra commented Jul 17, 2020

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.

@zivchen
Copy link

zivchen commented Sep 30, 2020

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

@IYarosh
Copy link
Author

IYarosh commented Sep 30, 2020

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

@iqqmuT
Copy link
Contributor

iqqmuT commented Sep 30, 2020

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

@mikehardy
Copy link
Collaborator

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

@iqqmuT
Copy link
Contributor

iqqmuT commented Oct 1, 2020

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.

@mikehardy
Copy link
Collaborator

mikehardy commented Oct 1, 2020

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.

@paour
Copy link

paour commented Nov 3, 2020

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

Ads

@iqqmuT
Copy link
Contributor

iqqmuT commented Nov 3, 2020

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

@jkpatel1463
Copy link

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.

@EugeneDGE
Copy link

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

@mikehardy
Copy link
Collaborator

mikehardy commented Nov 27, 2020

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

@usuf16
Copy link

usuf16 commented Dec 17, 2020

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

@mikehardy
Copy link
Collaborator

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

@usuf16
Copy link

usuf16 commented Dec 17, 2020

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,[]);

@mikehardy
Copy link
Collaborator

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

@Helyios
Copy link

Helyios commented Feb 16, 2021

Hello,

I am using the latest version of react-native (0.63.4) and the latest version of @react-native-firebase/app (^10.8.0) and I am getting the same issue :

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

@mikehardy
Copy link
Collaborator

@Helyios do not post on closed issues with insufficient details (i.e., all the things we would want in the full issue template). It does not provide us with anything to go on to help. You might examine the 'no IDFA' mode of my demo script https://github.com/mikehardy/rnfbdemo/blob/3b1095089e898c7629b8d530e1ad07b7998415d6/make-demo.sh#L11-L14

@Luckygirlllll
Copy link

Is there any update about this issue? I'm getting warning in Google Play that app is using AdMob.

@mikehardy
Copy link
Collaborator

@Luckygirlllll the comment right above yours is the current state of this closed issue:

do not post on closed issues with insufficient details (i.e., all the things we would want in the full issue template). It does not provide us with anything to go on to help. You might examine the 'no IDFA' mode of my demo script https://github.com/mikehardy/rnfbdemo/blob/3b1095089e898c7629b8d530e1ad07b7998415d6/make-demo.sh#L11-L14

@adar2378
Copy link

adar2378 commented Nov 2, 2021

If I modify the build.gradle file here node_modules/@react-native-firebase/analytics/android/build.gradle

implementation('com.google.firebase:firebase-analytics') To
implementation('com.google.firebase:firebase-analytics') { exclude module: "play-services-ads-identifier" }

then the play-services-ads-identifier gets removed. But I do not want to modify it from node_modules If I do it inside my app's build.gradle then it gets overridden by the firebase analytics package.

Is there anyway to modify it without modifying it inside the firebase analytics package inside node_modules?
@mikehardy

@mikehardy
Copy link
Collaborator

If this is a requirement and there's documentation upstream on how to do this (please link) then adding a gradle build variable that the script uses to determine whether to include it or not as a PR could work, similar to how we allow override of the firebase-android-sdk bom version

@adar2378
Copy link

adar2378 commented Nov 2, 2021

I don't have much idea about gradle build scripts. I found the solution for excluding play-services-ads-identifier here stack overflow link

Could you guide me if possible where to make the changes so that I don't have to modify node_modules folder to exclude the play-services-ads-identifier?

@mikehardy
Copy link
Collaborator

mikehardy commented Nov 2, 2021

@adar2378 for now for android I can only recommend using patch-package (though that's a strong recommendation: it works great, I use it personally) to make your fix "production-worthy" until the upstream issue is fixed https://github.com/ds300/patch-package

Then moving it forward it appears that you want to do two things:

  1. disable collection: https://firebase.google.com/docs/analytics/configure-data-collection?platform=android#disable_advertising_id_collection / implemented via these firebase.json toggles: https://rnfirebase.io/app/json-config#google_analytics_adid_collection_enabled (and the next one)

  2. wait for a fix on the play console check per here: Firebase-analytics adds Ad dependecy聽firebase/firebase-android-sdk#2582 (comment) (subscribe to that issue for updates)

I do confirm (via cd android && ./gradlew :app:dependencies) that analytics is bringing them in:

|    \--- com.google.firebase:firebase-analytics -> 20.0.0
|         +--- com.google.android.gms:play-services-measurement:20.0.0
|         |    +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
|         |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|         |    +--- com.google.android.gms:play-services-ads-identifier:17.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: android plugin: admob Google AdMob Type: Question Type: Stale Issue has become stale - automatically added by Stale bot
Projects
None yet
Development

No branches or pull requests