Search code examples
androidappsflyerappsflyer-android-sdk

Uninstall track with AppsFlyer SDK error


I have integrated AppsFlyer SDK for analytics, it is tracking app installs but somehow when using uninstalls feature it crashes.

I have initialized SDK in MyApplication

AppsFlyerLib.getInstance().startTracking(this, Constants.APPS_FLYER_KEY);

I dont have GCM/FCM in my application so i have followed Android Uninstall Tracking

So i have written this code in my manifest

<service android:name="com.appsflyer.FirebaseInstanceIdListener">
    <intent-filter>
        <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
    </intent-filter>
</service>

But it is not able to find FirebaseInstanceIdListener class enter image description here

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.appsflyer.FirebaseInstanceIdListener"

Solution

  • Check the Android SDK installation steps. I followed this so I was not able to reproduce it.

    So, I thought about possible cause, I tried to reproduce this error by simply not adding mavenCentral() in repositories object. And I faced the same error as you got.

    Just to make sure if you have added below lines in your app.gradle before dependencies object:

    repositories {
        mavenCentral() 
    }