Troubleshooting

Solve any SDK issues quickly with this guide, covering common errors and setup problems.

App compilation fails with "Duplicate class" or "Duplicate entry" exceptions.

This can happen when Gradle cannot resolve a dependency conflict, such as when two dependencies use the same transitive dependency but with different versions. To resolve this conflict you must either:

  • Remove one of the conflicting dependencies.

  • Align the versions of the conflicting dependencies to match.

If the affected dependency is one of your app's dependencies, simply adjust or remove it from the dependencies list in your build.gradle. If the affected dependency is transitive, you must exclude it from the dependency which specifies it as a transitive dependency.

Duplicate class due to androidx.work:work-runtime:$workVersion.

Our SDK supports pre-AndroidX projects, so we are using the work-runtime library that predates AndroidX. There is an issue with the Android Gradle plugin <3.6.0 where the Jetifier does not correctly replace the dependency. If you are not already using a supported version of Gradle, you need to bump the version in your root project's build.gradle file.

buildscript {

    repositories {
        google()
        mavenCentral()
        ...
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.0' // Set this to 3.6.0 or higher.
        ...
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

Please also ensure that you have enabled the Jetifier by placing the line android.enableJetifier=true into your gradle.properties file.

If you continue to have issues due to a conflict between the versions of the androidx.work:work-runtime library in your project, you can fix this issue by adding the following to your app level build.gradle file.

The currently supported version of work-runtime is up to 2.0.1


Last updated