Search code examples
androidappsflyerappsflyer-android-sdk

Build fails when AppsFlyer is used with ProGuard


I'm following this manual to integrate AppsFlyer into our Android app.

When I try to build the project with minifyEnabled true the following warnings appear in the build log:

Warning: com.appsflyer.GcmInstanceIdListener: can't find superclass or interface com.google.android.gms.iid.InstanceIDListenerService

Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceID

Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceIDListenerService Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceID Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceID

Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceIDListenerService

Warning: com.appsflyer.GcmInstanceIdListener: can't find referenced class com.google.android.gms.iid.InstanceIDListenerService

Warning: com.appsflyer.u: can't find referenced class com.google.android.gms.iid.InstanceIDListenerService

And the build fails.

Here is relevant part of the app's module build.gradle:

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.appsflyer:af-android-sdk:4+@aar'
    implementation 'com.android.installreferrer:installreferrer:1.0'
}

Here is relevant part of ProGuard configuration:

-dontwarn com.android.installreferrer

Solution

  • Please add the following as well:

    -dontwarn com.appsflyer.**
    

    https://support.appsflyer.com/hc/en-us/articles/207032126-AppsFlyer-SDK-Integration-Android#11-known-issues