googlesamples / unity-jar-resolver

Unity plugin which resolves Android & iOS dependencies and performs version management
Other
1.22k stars 339 forks source link

Remove Dependency (Android Advertising ID AAID) #510

Closed ArnauKokoro closed 2 years ago

ArnauKokoro commented 2 years ago

[REQUIRED] Please fill in the following fields:

[REQUIRED] Please describe the question here:

Hi,

As a 1st April 2022 Google's permissions changes. AAID is not supported on Families Policies for children apps. So I have to remove every dependency which could use it from my app.

I could add a meta tag on the Android's Manifest to disable Analytics for recollect AAID, but I think my main problem now is that firebase-unity library also installs this dependency: com.google.android.gms.play-services-ads-identifier which seems to be causing the caution message about using AdMob on Play Console and is related for my app to not being accepted by google reviewer because it uses AAID.

My question here is: Is there a way to remove a single dependency from Android Resolver dependencies generated by the firebase-unity libraries installation?

I tried to remove it from AndroidResolverDependencies.xml but every time I make a build it's recreated.

Thanks!

google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

paulinon commented 2 years ago

Hi @ArnauKokoro,

Thanks for reporting this. Is auto-resolution enabled in your Android Resolver Settings? This could be the reason why the dependency is recreated every time you make a build.

Let me know if disabling auto-resolution solves this. Otherwise, please provide the steps you've performed in trying to solve this issue.

ArnauKokoro commented 2 years ago

Thanks @paulinon !!

I had disabled AutoResolverEnabled but I had enabled AutoResolveOnBuild. Disabling AutoResolveOnBuild and deleting the dependency from AndroidResolverDependencies.xml I could make a build and see that the dependency is not in the gradle file.

I'm gonna send this build to google reviewing and make you update to see if it pass the review.

Thanks!!

ArnauKokoro commented 2 years ago

@paulinon Even without dependency: com.google.android.gms.play-services-ads-identifier, Google is rejecting the app.

I need help to know which dependencies could be using AAID. These are the dependencies I am using:

implementation(name: 'com.google.android.datatransport.transport-api-3.0.0', ext:'aar')
implementation(name: 'com.google.android.datatransport.transport-backend-cct-3.0.0', ext:'aar')
implementation(name: 'com.google.android.datatransport.transport-runtime-3.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-16.0.1', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-api-phone-17.4.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-auth-base-16.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-base-17.6.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-basement-17.6.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-cloud-messaging-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-api-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-base-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-impl-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-sdk-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-measurement-sdk-api-20.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-safetynet-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-stats-17.0.0', ext:'aar')
implementation(name: 'com.google.android.gms.play-services-tasks-17.2.1', ext:'aar')
implementation(name: 'com.google.android.play.core-1.10.3', ext:'aar')
implementation(name: 'com.google.firebase.firebase-abt-21.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-analytics-20.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-analytics-unity-8.8.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-app-unity-8.8.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-auth-21.0.1', ext:'aar')
implementation(name: 'com.google.firebase.firebase-auth-interop-20.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-auth-unity-8.8.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-common-20.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-components-17.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-config-21.0.1', ext:'aar')
implementation(name: 'com.google.firebase.firebase-config-unity-8.8.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-datatransport-18.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-encoders-json-18.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-iid-21.1.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-iid-interop-17.1.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-measurement-connector-19.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-messaging-23.0.0', ext:'aar')
implementation(name: 'com.google.firebase.firebase-messaging-unity-8.8.0', ext:'aar')

Some of these could be using AAID?

Many Thanks!

paulinon commented 2 years ago

Hi @ArnauKokoro,

Have your tried disabling Advertising ID collection in your AndroidManifest.xml file? If not, simply add this in the application tag:

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

Let me know how it goes.

ArnauKokoro commented 2 years ago

Hi @paulinon,

I didn't mention that on the post, but it was the first thing I did.

Thanks!

paulinon commented 2 years ago

Hi @ArnauKokoro,

Is your app still rejected even after disabling both the Advertising ID collection in your AndroidManifest.xml file and auto-resolution which prevents the com.google.android.gms.play-services-ads-identifier dependency from being generated? If so, could you try if disabling SSAID collection would make a difference?

ArnauKokoro commented 2 years ago

Hi @paulinon I was waiting for the last app review to answer. Finally I've got approved!! It seems to be just com.google.android.gms.play-services-ads-identifier but the problem was that after removing that dependency from AndroidResolverDependencies.xml, disabling AutoResolveOnBuild on External Dependency Manager - Android Resolver Settings and adding <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" /> to AndroidManifest.xml it was still a place where I had written com.google.android.gms.play-services-ads-identifier and that place was proguard. There I had:

-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
    com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
    java.lang.String getId();
    boolean isLimitAdTrackingEnabled();
}

So Google Systems thought I was using it. I also removed com.google.firebase.firebase-installations and com.android.installreferrer.installreferrer from AndroidResolverDependencies.xml as a dependencies but I don't thing these were the problem.

Many thanks !!