31

I just updated my android studio and i'm getting this error:

Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException:
java.lang.RuntimeException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
java.lang.IllegalStateException: Multi dex requires Build Tools 21.0.0
/ Current: 19.1
Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
Stanley Hayford
  • 311
  • 1
  • 3
  • 3

6 Answers6

33

Here are the couple of things which you can solve the problem.

  1. Change the USB computer connection to Camera(PTP) from Media device(MTP) in your smart phone

  2. Change the Build version to 21.1.2 in build.gradle(Module: app)

    enter image description here

  3. Make sure that Android SDK build tools [build-tool;21.1.2] is installed otherwise install it

    enter image description here

  4. After this just run the project.

Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
  • just in case images get deleted/moved... 2) change buildToolsVersion in build.gradle (Module: app) – rluks Apr 17 '16 at 20:29
6

A bit old question but I hope you overcome from your problem.

Today I updated my Android Studio to version 2.1 and, and the buildToolVersion to the latest 23.0.3 (as of 8th,May,2016)

The issue you faced happened to me today as well in one of my project and as it described in your error log too, the project built tool is older than the current.

So, if you raise your build tool to the at least the min required or higher, you can successfully build your project.

To do that, open your build.gradle(Module:app), configure it similar to following:

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.yoursite.yourapp"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

Hope it helps to others as well.

Gulbala Salamov
  • 198
  • 3
  • 9
1

Changing buildToolsVersion to 21.1.2 works very well for me. Every time I update Android Studio, I get new errors.

0

For me, changing the buildToolsVersion from "24.0.0 rc3" to "21.1.2" fixed the issue. This is in the build.gradle (Module: app) file.

SkyWalker
  • 151
  • 2
  • 4
0

I faced a similar issue and i did 3 workarounds. I don't know which one fixed the issue. Or may be all of them.

  1. I have java library module. it depends on some jars. I removed unnecessary jars.
  2. I extracted code from inside the java library module and added it directly to my app and removed the java library module.
  3. I added these lines to my gradle file:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    
Emile Bergeron
  • 17,074
  • 5
  • 83
  • 129
Hisham Bakr
  • 559
  • 4
  • 13
0

I recently read this answer in SO

For me the problem was solved after I removed jar file from my project. it seems that one of the jar files inside my project was using an older version of google play services.

Community
  • 1
  • 1
Arpit Patel
  • 7,212
  • 5
  • 56
  • 67