when i want to sync gradle i get this error:
Error:Access to the dex task is now impossible, starting with 1.4.0
1.4.0 introduces a new Transform API allowing manipulation of the .class files.
See more information: http://tools.android.com/tech-docs/new-build-system/transform-api
When i click the link, i don't find any solution. Anyone have solution thanks.
As suggested in other answers, downgrade is one option. But, it is not a solution. As asked by David Argyle Thacker, what if we actually want to use a newer version (of gradle build tool)?
I was having same trouble while upgrading gradle tool version in one of my projects. So, I did following and voila, it worked.
Add multiDexEnabled true to the defaultConfig in /app/build.gradle.
Remove all the code you have previously written to get MultiDexing to work. For instance,
Remove the
afterEvaluate
block for MultiDexRemove
multidex
dependencyRemove the code from
AndroidManifest.xml
If you are using custom Application class by extending android.app.Application, then remove
MultiDex.install(base);
Update the build tool version to
2.1.2
(highest stable version available at the time of writing) in /build.gradleGradle Sync the project, by clicking Sync now
Hope this helps.
http://www.pcsalt.com/android/solution-access-dex-task-now-impossible-starting-1-4-0
Try downgrading your gradle version to 1.3.0
set your gradle version explicitly to 1.3.0 in dependencies section of build.gradle file