简体   繁体   中英

Android build fails with out of memory on aapt (error=8)

I am just playing around with Google's Android Studio IDE and trying to set up a project that uses ABS and ViewPagerIndicator. However, I can't get the projects to build, because every time I run gradle from the command line (or from the IDE) it fails with the following message:

java.io.IOException: Cannot run program "C:\[path shortenend]\android-studio\sdk\build-tools\android-4.2.2\aapt.exe": CreateProcess error=8, <german version of "there is not enough memory available for this command">

In the resource monitor I see that it always stops when it has around 600MB of memory, so I tried increasing the heap size by setting -Xmx1024m or even -Xmx2048m in the GRADLE_OPTS . The error still remains however, although I can see in the debug mode that the parameters are getting passed to the Java VM when the build starts. Are there any other ways to increase the available memory for gradle so I can actually build my project?

EDIT: any solutions besides increasing the available memory are of course also welcome.

EDIT2: I'm using Gradle 1.6 and ADT rev 22

Currently studio creates Gradle project that use the Gradle plugin version 0.4 which had this bug.

Update your build.gradle to make the dependency be

com.android.toold.build:gradle:0.4.+

This will pick up the latest 0.4.x which has the fix for this.

Which version of gradle are you using? are you using Android SDK platform tools revision 14?

if so, try to update to the latest one. ref: AAPT Stackoverflow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM