Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle error after upgrading to Android Studio to 2.0 Preview and using Instant Run

When I try to run my project which works great 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 some questions here regarding this error, but all answer are to downgrade Gradle to 1.3 version, which I can't do with the new Android Studio and the Instant Run option.

Is there another solution to this problem?

like image 783
Emil Adz Avatar asked Nov 24 '15 09:11

Emil Adz


Video Answer


1 Answers

I was able to solve this by enlarging the max heap size in my build.gradle add this to your android closure:

 dexOptions {
    javaMaxHeapSize "4g"
 } 

not sure what it has to do with the new api

like image 200
zwebie Avatar answered Oct 27 '22 00:10

zwebie