Search code examples
androidlyft-api

Lyft Android SDK integration issue


I added Lyft android SDK dependency in my app in dependency section of build.gradle file as below

implementation "com.lyft:lyft-android-sdk:1.0.3

But I am getting below error while running app on mobile device:-

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDevDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org

BUILD FAILED in 3m 33s

I try to solve above issue by adding multiDexEnabled true in default config of app gradle, but it doesn't work.

I am using Android Studio 3.0.1 and gradle 4.1 version.


Solution

  • I investigated issue more by enabling stack trace in gradle build process and looking out stack trace log.

    In stack trace I found there is a duplicate class from org.jetbrains.annotations package which is coming from two different dependency module. one dependency module was from kotlin dependency and one was from lyft sdk dependency module. So I added Lyft sdk dependency as like below in build.gradle and it works for me.

    implementation ("com.lyft:lyft-android-sdk:1.0.3"){
            exclude group: 'org.jetbrains', module:'annotations-java5'
        }