When i\'m trying to debug my android app i\'m getting the following error message:
Error:Execution failed for task \':app:transformClassesWithDexFor
I had the same issue, solved it by doing the following
In the app build gradle file, inside android: add in defaultConfig:
multiDexEnabled true
and add this in the android:
dexOptions {
javaMaxHeapSize "4g"
}
Ref: https://stackoverflow.com/a/25006428/2069407
At my case change buildToolsVersion from "24" to "23.0.2", solve the problem especially if you're using old Android Studio less than version 2
Just had the issue yesterday. I fixed it by manually removing the build/
and app/build/
folders, and by building the project again.
But it also might come from something else like your app reaching the 65k methods limit (in what case "Configuring Your App for Multidex with Gradle" will fix your issue). So you will need to provide the full Graddle log for us to be able to check more in detail what the issue could be.