Android compilation error Task :app:checkDebugDuplicateClasses FAILED

32 views Asked by At

I have requirement where Android App wants to include 2 third party libs e.g. LIB1.aar and LIB2.aar

  1. LIB1.aar and LIB2.aar are using the one common J2XX.jar for FTDI(USB) connectivity

  2. When we are including both the libs we are getting the following error

    Task :app:checkDebugDuplicateClasses FAILED
    Execution failed for task ':app:checkDebugDuplicateClasses'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
    > Duplicate class com.ftdi.j2xx.BulkInWorker found in modules LIB1 (com.xxx:LIB1) and  LIB2.aar
      Duplicate class com.ftdi.j2xx.D2xxManager found in modules LIB1 and LIB2.aar
    
  3. Library provider is not ready to remove the j2XX.jar for FTDI(USB).

  4. We tried to exclude j2XX from LIB1 dependency using this but getting following error

    implementation 'com.xxx:LIB1' {
            exclude module: 'd2xx'
    }
    
    A problem occurred evaluating project ':app'.
    > Could not find method com.xxx.lib1:1.0() for arguments [build_e9ui15c2eip9zzdvxl3zzzf73$_run_closure2$_closure7@7195973c] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler
    

let me know possible solution?

Expecting gradle script changes to include one j2xx.jar

0

There are 0 answers