Closed Ashkan-Oliaie closed 1 year ago
Hello
I can reproduce the issue in release for the example provided in this mParticle Flutter SDK. Tested on Android 13 real device (Samsung Galaxy S20+).
When we build APK in release using command: flutter build apk --release Android advertising id will not be collected and sent for some reason but its working fine in debug/dev.
mParticle SDK team please investigate.
Thanks
Hi!
I am from the mParticle TSE team, we have a ZD ticket raised for this issue.
We are trying to reproduce the issue in order to get more data to fill a bug for our engineering team.
We will keep you posted in the ZD ticket with any relevant information we learn of.
Regards,
Hi @sefidgaran question for you - are you including com.google.android.gms:play-services-ads-identifier
as a dependency in your build? also are you using proguard/minification? in your production build?
In case if you are not aware, we received an update from mParticle team through ticket system mentioned earlier that mParticle reproduced the issue.
yep I am aware. Engineering investigated the bug that the TSE team logged - and the issue is that the default proguard/minify rules for either play services or that's generated by gradle no longer includes rules to avoid minifying the play services library.
We use reflection to grab the Google Ad ID, and so when you obfuscate the play services code in your app (you likely only have this enabled for your production builds), and it renames the play services classes, it breaks.
we are going to add an update to our SDK to add these rules to our consumer-proguard
file which your app will then inherit. That said - you can work around this right now with any SDK version by avoiding the minification of the play services AdvertisingIdClient.
For example - add this to your Flutter app's proguard file:
-keep class com.google.android.gms.ads.identifier.** { *; }
Hi @samdozor After I investigated on this issue looks like the issue is fixed in mParticle end and we are receiving Android AD ID in production without any changes in our code/proguard rules. anyway thanks for your comments.
@Ashkan-Oliaie please confirm. Thanks
I can confirm that the issue is fixed on mParticle side. We're receiving android_advertising_id. Thanks everyone
@sefidgaran @Ashkan-Oliaie happy to hear it's resolved - though it's odd because we didn't make any update. Keep the above recommendation in mind if the issue presents itself again in the future.
Hi, We've been trying to integrate mParticle and include android_advertising_id. We faced the issue that can not send/receive android_advertising_id, though it's working fine on debug/dev mode, when building a release apk, it's not there.
We ensured adding the dependencies and permissions But we are facing these issue :
Failed to collect Advertising ID, be sure to add Google Play services (com.google.android.gms:play-services-ads) or Amazon Ads (com.amazon.android:mobile-ads) to your app's dependencies.
any idea what might be the issue ?