CircleCI - Android build randomly falls

Hello,

we had a working Android “workflow setup” a week ago:

Today, our configuration starts to fail randomly with no (or just cosmetic) changes. Here are build errors from the last few builds:

java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
Exception in thread "ForkJoinPool.commonPool-worker-18" java.lang.IllegalStateException:
AAPT Process manager cannot be shut down while daemons are in use
* What went wrong:
Execution failed for task ':app-samples:packageRelease'.
> Execution of compression failed.
Caused by: com.android.builder.dexing.DexArchiveBuilderException: java.util.zip.ZipException:
error reading zip file
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
> java.io.IOException: Cannot allocate memory
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException

Our config file:

Please, how we can fix it? :slight_smile:

Hi Tomáš. Since it is talking about memory, can you review the settings on this docs page https://circleci.com/docs/2.0/java-oom/ and see if any of them will help? Without them, Java tends to try and use all the memory on the box, not just what is allowed to it, so it can easily run out.

java.io.IOException: Cannot allocate memory

This seems to happen more-or-less “out of the box” when working with Android and CircleCI.

CircleCI’s documentation on JVM Out-of-memory errors may be technically rounded, but it has no clear call to action. CircleCI could strive for a simpler guide.