Stanley Hayford
Stanley Hayford

Reputation: 311

Error: Multi dex requires Build Tools version

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

Upvotes: 31

Views: 37127

Answers (6)

Hisham Bakr
Hisham Bakr

Reputation: 559

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
    }
    

Upvotes: 0

Vishnu Viswanathan
Vishnu Viswanathan

Reputation: 445

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.

Upvotes: 33

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

Upvotes: 1

Gulbala Salamov
Gulbala Salamov

Reputation: 308

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.

Upvotes: 6

Arpit Patel
Arpit Patel

Reputation: 8057

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.

Upvotes: 0

SkyWalker
SkyWalker

Reputation: 161

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.

Upvotes: 0

Related Questions