firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.23k stars 566 forks source link

Firebase-analytics adds Ad dependecy #2582

Closed shumidub closed 1 year ago

shumidub commented 3 years ago

When I'm using com.google.firebase:firebase-analytics:18.0.2 package com.google.android.gms.ads.identifier.AdvertisingIdClient appears into my apk. And Play Console show warning "Ad SDK found"

изображение

I want to have a way to use firebase analytics without AD SDK.

Similar issue https://github.com/invertase/react-native-firebase/issues/3617

google-oss-bot commented 3 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

aguatno commented 3 years ago

Hi @shumidub thanks for reaching out. Per this help center article: "By default, the Firebase SDK collects identifiers for mobile devices (for example, Android Advertising ID and Advertising Identifier for iOS) ..."

This is done to enable attribution, as well as reporting on demographics and interests. If you'd like to continue reporting Ad ID, Google Play now requires publishers that collect Ad ID to submit a privacy policy. Otherwise If the developer doesn't want to collect Ad ID, they can disable collection instead.

shumidub commented 3 years ago

But after add meta-data to Manifest Ads classes also is in apk изображение

And Google Play show warning изображение

mobile-sergey commented 3 years ago

I have same error on Google Play (And I havn't this error month ago): Безымянный But in my project havn't AdMob, only Firebase: AndroidStudio

// Firebase
    implementation platform('com.google.firebase:firebase-bom:26.6.0')
    implementation 'com.google.firebase:firebase-core'
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
mobile-sergey commented 3 years ago

How I can delete AdMob SDK from App without deleting Firebase? Becouse I need to publish app without advertising.

mobile-sergey commented 3 years ago

Thanks https://github.com/invertase/react-native-firebase/issues/3617. The problem with AdMob SDK is in com.google.android.gms:play-services-ads-identifier that is inside com.google.firebase:firebase-core and com.google.firebase:firebase-analytics

For fixing I change my dependencing like this:

    // Firebase
    implementation platform('com.google.firebase:firebase-bom:26.6.0')
    implementation ('com.google.firebase:firebase-core') {
        exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
    }
    implementation ('com.google.firebase:firebase-messaging') {
        exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
    }
    implementation ('com.google.firebase:firebase-crashlytics') {
        exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
    }
    implementation ('com.google.firebase:firebase-analytics') {
        exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
    }

And now my Firebase working and Google Play don't show warnings: GooglePlay

P.S: Sorry that Russian on screenshots. This is becouse I don't know how to change language in Google Play Console. But I hope that you understand main idea of screenshots.

mobile-sergey commented 3 years ago

Unfortunatelly my fix not working :( Does anybody knows how to fix it?

shumidub commented 2 years ago

Analytics use: The advertising identifier may only be connected to personally-identifiable information or associated with any persistent device identifier (for example: SSAID, MAC address, IMEI, etc.) with the explicit consent of the user

https://support.google.com/googleplay/android-developer/answer/10808976?hl=en

shumidub commented 2 years ago

I want to disable collecting ads id from my application for my peace of mind

shumidub commented 2 years ago

And I want to remove com.google.android.gms:play-services-ads-identifier dependency from my app to hide "Ads warning" in the Play Console

aguatno commented 2 years ago

Hi all, Sorry for getting back late. To disable id collection, please follow our guide here and I've submitted a request to fix the Ads warning in Google Play. I'll keep you posted.

KishanDasani commented 2 years ago

Hi there,

I'm using ionic 3 with cordova-plugin-firebasex and got warning in play store.

I found that this can be solved by adding exclude module: "play-services-ads-identifier" to build.gradle.

But when I do ionic cordova build android, it overwrites the changes in build.gradle file.

So is there any way to remove the admob sdk (play-services-ads-identifier) from ionic 3 project?

mobile-sergey commented 2 years ago

Hi all, Sorry for getting back late. To disable id collection, please follow our guide here and I've submitted a request to fix the Ads warning in Google Play. I'll keep you posted.

I add to AndroidManifest.xml: <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />

But after publish to GooglePlay I get "SDK AdMob" again. And this not fixed the problem.

mobile-sergey commented 2 years ago

Analytics use: The advertising identifier may only be connected to personally-identifiable information or associated with any persistent device identifier (for example: SSAID, MAC address, IMEI, etc.) with the explicit consent of the user

https://support.google.com/googleplay/android-developer/answer/10808976?hl=en

Sorry, this page can't be found.

mobile-sergey commented 2 years ago

Dear developers of Firebase. Can you connect to developers of GooglePlay? You have been working for the same company Google. Please fix this bug with developers of GooglePlay. May be this bug in GooglePlay?

mericgerceker commented 2 years ago

Hello. Are there any new developments for issue?

lordcodes commented 2 years ago

You can just add to the AndroidManifest to remove the 'AD_ID' permission and then also tell the Firebase Analytics SDK not to collect it.

The documentation for the class included by the play-services-ads-identifier, explains how the AD ID is used and how to avoid any transitive dependencies from adding the permission.

https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#getId()

I can see part of this was already posted, but just included it for completeness and discoverability.

AndroidManifest.xml

<uses-permission
        android:name="com.google.android.gms.permission.AD_ID"
        tools:node="remove" />

<meta-data
            android:name="google_analytics_adid_collection_enabled"
            android:value="false" />
Bardiamist commented 1 year ago

Faced with same issue

image

Will firebase.json

{
  "react-native": {
    "google_analytics_adid_collection_enabled": false
  }
}

work instead of

<meta-data
    android:name="google_analytics_adid_collection_enabled"
    android:value="false" />

?

Of course with

<uses-permission
    android:name="com.google.android.gms.permission.AD_ID"
    tools:node="remove" />
EverGreeff commented 1 year ago

D

This not work with a android studio Firebase project, the permission is not on the merged manifest anymore, but google still showing the erro message

deepak786 commented 1 year ago

Screen Shot 2022-07-27 at 1 32 59 PM

I just selected yes in the Play Console.

M001T commented 1 year ago

Screen Shot 2022-07-27 at 1 32 59 PM

I just selected yes in the Play Console.

you just selected yes and worked ?

deepak786 commented 1 year ago

@M001T Yes.

kunwar295 commented 1 year ago

I have Contacted to Google Play support they replied that if you use analytics, you need to choose YES on The AD_ID permission for analytics use case on Advertising ID section.

You should not remove permission manually or remove analytics sub-modules which contains AD_ID permission since it can break things...

So just need to choose YES even if the app is not using Ads All you have to do is: Go to Google play console App Content -> Advertising ID section -> Choose Yes and mark the Analytics option and check Turn off release errors check box

Ktc60 .

FauziAmth commented 1 year ago

I have Contacted to Google Play support they replied that if you use analytics, you need to choose YES on The AD_ID permission for analytics use case on Advertising ID section.

You should not remove permission manually or remove analytics sub-modules which contains AD_ID permission since it can break things...

So just need to choose YES even if the app is not using Ads All you have to do is: Go to Google play console App Content -> Advertising ID section -> Choose Yes and mark the Analytics option and check Turn off release errors check box

Ktc60 .

Why would they need to ask if they force it anyway?

IMO App functionality, Analytics & Developer Communications should be seperated from "advertising ID"

danielesegato commented 1 year ago

@aguatno please this is become urgent. Google Play now block apps from releasing

Screenshot from 2022-09-26 17-22-27

My app doesn't have ads. Just Firebase Analytics

Even doing all this the google play still complains:

in the manifest

<uses-permission
        android:name="com.google.android.gms.permission.AD_ID"
        tools:node="remove" />

inside application tag

<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />

and dependency:

    implementation(platform("com.google.firebase:firebase-bom:30.4.1")
    implementation("com.google.firebase:firebase-analytics-ktx") {
        exclude(module = "play-services-ads-identifier")
    }

Nothing, the Google Play still complains with that error when trying to create a new release

mikehardy commented 1 year ago

With apologies - I need everyone to understand that I/we are not in control of this here. The repo you want to chase down is firebase-android-sdk / possibly in concert with Play Store support. I am sorry that I can't be more help but this is not something we add here or control here.

I see you have posted there as well, so this is largely duplicate: https://github.com/firebase/firebase-android-sdk/issues/2582

I will only leave this open for information purposes / possible updates only, but that bug 2582 over on firebase-android-sdk is the one to follow. Then if they release a change we can adopt it here as needed

argzdev commented 1 year ago

Hi @danielesegato, could you try removing the code you've altered, and add the solution provided by kunwar295? If I'm not mistaken, there's no extra code setup needed. All that's needed is the declaration that an Advertising ID is being used in third party library (Firebase Analytics). This can be done through your Google Play Console, and that should be sufficient enough to remove the error.

I don't think there should be any more issue here since this should be working after proper declaration in Google Play Console. I'll close this issue for now. If this is still not working, let me know and I'll reopen the issue. Thanks!

moertel commented 1 year ago

@danielesegato and others - for some reason adding <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" /> is what caused the permission to appear in my merged manifest. As soon as I removed this line, everything was fine.

Firebase services I use

My app includes no ads whatsoever. All I want is crashlytics, performance monitoring and analytics:

dependencies {
    implementation platform('com.google.firebase:firebase-bom:29.1.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-perf'
    implementation 'com.google.firebase:firebase-firestore'
}

Configuration that worked for me

With the configuration as below I was able to get rid of the warning in GooglePlay console: app/build.gradle

configurations.all {
    exclude group: 'com.google.android.gms', module : 'play-services-ads'
    exclude group: 'com.google.android.gms', module : 'play-services-ads-identifier'
    exclude group: 'com.google.android.gms', module : 'play-services-ads-lite'
}

app/src/main/AndroidManifest.xml

    <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
    <meta-data android:name="google_analytics_default_allow_ad_personalization_signals" android:value="false" />

Again, if you have the following line in your AndroidManifest, ⚠️try removing it.

<!-- remove this -->
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
jeiea commented 1 year ago
image

I'm seeing this even if I remove all app bundles in the release.

I want explicit documentation for requiring Ad ID usage declaration for analytics dependency. Is it play store bug or requirements? I can't know.

argzdev commented 1 year ago

Hi @jeiea, you could check out the documentation which contains the explanation for requiring Ad ID, under the section of Identifiers for mobile devices.

The Google Analytics for Firebase SDK automatically generates and assigns an app-instance identifier to each instance of your app. Analytics uses the ID to identify unique installations of your app and compute user metrics. Learn more about the app-instance ID.

By default, the SDK collects identifiers for mobile devices (for example, Android Advertising ID and Advertising Identifier for iOS) and uses technologies similar to cookies.

As for the issue, I assume this is a bug where even if you remove all your app bundle, the most recent app bundle is still retained (you would notice this when you try to upload the same app bundle again, an error would come out), but I could be wrong though. That said, I think it would be best to reach out to the Play Console help support. Alternatively, updating your declaration will remove the error.

mobile-sergey commented 1 year ago

Repeat my words:

Dear developers of Firebase. Can you connect to developers of GooglePlay? You have been working for the same company Google. Please fix this bug with developers of GooglePlay. May be this bug in GooglePlay?

argzdev commented 1 year ago

Hi @mobilase, we can probably raise this up to our engineering team and see if it's possible to talk to some GooglePlay folks if the issue still persists to our developers. It looks like a lot of our developers have been able to resolve the issue with the given solution.

From what I see, this is no longer a bug but more of a requirement on Google Play Console. That said, updating your declaration should already remove the error. I don't see any reason why this shouldn't work.

Are you still experiencing the issue you've previously mentioned? Have you tried the solution provided by kunwar295 and moertel?

mobile-sergey commented 1 year ago

Solution of kunwar295 is not for me. Because I need to control that Advertising ID not used in my app.

Solution of moertel interested and I test it when I get back to development of Android app with Firebase. But I test similar solution and this is not working (see my next comment)

argzdev commented 1 year ago

Got it, let me know if moertel's solution works.

danielesegato commented 1 year ago

Hi @danielesegato, could you try removing the code you've altered, and add the solution provided by kunwar295? If I'm not mistaken, there's no extra code setup needed. All that's needed is the declaration that an Advertising ID is being used in third party library (Firebase Analytics). This can be done through your Google Play Console, and that should be sufficient enough to remove the error.

I don't think there should be any more issue here since this should be working after proper declaration in Google Play Console. I'll close this issue for now. If this is still not working, let me know and I'll reopen the issue. Thanks!

@argzdev I as you suggested: I declared my app uses AD ID for analytics by third party.

I was afraid this would make my app show as "Contain Ads" or something like that but it didn't. I still find it a bit odd that something about "AD" is needed for analytics but I'm OK with this.

It is not straight forward tho' and I think you should definitely get in touch with your Google Play colleagues to improve a bit the communication around this, at least in the Google Play side :)

Thanks for your time!