adjust / android_sdk

This is the Android SDK of
http://www.adjust.com
Other
593 stars 299 forks source link

Issues with AGP 8 / R8 Full Mode #578

Closed PHELAT closed 1 year ago

PHELAT commented 1 year ago

Hi!

Apparently R8 full mode is active by default in AGP 8+, and seems like Adjust needs some Proguard adjustments. Currently we get these errors when trying to run the minifyWithR8 task:

Missing class com.bun.miitmdid.core.MdidSdkHelper (referenced from: void com.adjust.sdk.oaid.AdjustOaid.readOaid(android.content.Context) and 1 other context)
Missing class com.bun.miitmdid.interfaces.IIdentifierListener (referenced from: com.adjust.sdk.oaid.OaidInfo com.adjust.sdk.oaid.MsaSdkClient.getOaidInfo(android.content.Context, com.adjust.sdk.ILogger, long) and 1 other context)
Missing class com.bun.miitmdid.interfaces.IdSupplier (referenced from: void com.adjust.sdk.oaid.MsaSdkClient$1.onSupport(com.bun.miitmdid.interfaces.IdSupplier))
Missing class com.huawei.hms.ads.identifier.AdvertisingIdClient$Info (referenced from: com.adjust.sdk.oaid.OaidInfo com.adjust.sdk.oaid.HmsSdkClient$1.call())
Missing class com.huawei.hms.ads.identifier.AdvertisingIdClient (referenced from: com.adjust.sdk.oaid.OaidInfo com.adjust.sdk.oaid.HmsSdkClient$1.call())

Adjust: 4.33.5 AGP: 8.0.2

Please let me know if you need any additional information.

shashanksu commented 1 year ago

Hi @PHELAT,

Thanks for reporting this. Indeed, we could see that the proguard rules for minifyWithR8 tasks are not mentioned. We will soon update it. Meanwhile, can you please add below proguard rules and let us know if it works? Thanks.

-dontwarn com.bun.miitmdid.** -dontwarn com.huawei.hms.ads.identifier.**

PHELAT commented 1 year ago

Yes, the dontwarn rules work in not throwing errors. But, is it just a false positive?

shashanksu commented 1 year ago

Have you added the MSA and HMS Core SDK dependencies as mentioned in the doc?