2

I am using

Android Studio 3.5, gradle-5.4.1-all.zip, com.android.tools.build:gradle:3.5.0, org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

I got error when i rebuild project:

What went wrong: Execution failed for task ':app:mergeExtDexProductionDebug'. Could not resolve all files for configuration ':app:productionDebugRuntimeClasspath'.

Failed to transform artifact 'protobuf-java.jar (com.google.protobuf:protobuf-java:3.10.0)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.usage=java-runtime-jars}.

Execution failed for DexingWithClasspathTransform: C:\Users\xxx\.gradle\caches\modules-2\files-2.1\com.google.protobuf\protobuf-java\3.10.0\410b61dd0088aab4caa05739558d43df248958c9\protobuf-java-3.10.0.jar.

Error while dexing.

I had google, but i can not get solution for this case

Can you help me resolve this problem?

Thanks in advance.

2 Answers 2

2

Solution by OP.

I solved my problem with code below:

configurations.all {
    resolutionStrategy {
        force("com.google.protobuf:protobuf-java:3.11.0-rc-1")
    }
}
0

In app build.gradle file add this-

android{

  .........

  aaptOptions {  
     cruncherEnabled = false  
  }
  ................  
}

Now, build, clean and rebuild project.

If still not got the solution try to downgrade your build version and again build the project.

1
  • i had tried with 2 your solution, but i still got this error
    – ThanmaDW
    Commented Nov 22, 2019 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.