Gradle after upgrading to Android Studio 2.0 and using Instant Run:

When I try to run my project, which works fine on Android Studio 1.5, I get the following 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 

I saw a few questions here regarding this error, but they are all responsible for downgrading gradle to 1.3, which I cannot do with the new version of Android Studio and Instant Run.

Is there any other solution to this problem?

Thanks in advance.

+6
source share
1 answer

I was able to solve this by increasing the maximum heap size in my build.gradle add this to Android closing:

  dexOptions { javaMaxHeapSize "4g" } 

not sure what it should do with the new api

+3
source

All Articles