Reputation: 311
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
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.
I added these lines to my gradle file:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
Upvotes: 0
Reputation: 445
Here are the couple of things which you can solve the problem.
Change the USB computer connection to Camera(PTP) from Media device(MTP) in your smart phone
Change the Build version to 21.1.2 in build.gradle(Module: app)
Make sure that Android SDK build tools [build-tool;21.1.2] is installed otherwise install it
After this just run the project.
Upvotes: 33
Reputation: 19
Changing buildToolsVersion to 21.1.2 works very well for me. Every time I update Android Studio, I get new errors.
Upvotes: 1
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
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
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