Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker container for Android : Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)

Tags:

android

docker

I am try to build android on Docker container, I am getting every time this error for ./gradlew assembleDebug

:saltside-android:transformClassesWithDexForBikroyDebugThe message received from the daemon indicates that the daemon has disappeared. Build request sent: BuildAndStop{id=81f2e456-bb5b-4cf8-9190-3c8b22e286b6.1, currentDir=/app/project-main} Attempting to read last messages from the daemon log... Daemon pid: 35 log file: /root/.gradle/daemon/3.3/daemon-35.out.log ----- Last 20 lines from daemon log file - daemon-35.out.log ----- :saltside-android:processBugsnagBikroyDebugManifest :saltside-android:processBikroyDebugResources :saltside-android:generateBikroyDebugSources :saltside-android:incrementalBikroyDebugJavaCompilationSafeguard :saltside-android:javaPreCompileBikroyDebug :saltside-android:compileBikroyDebugJavaWithJavacNote: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. : :saltside-android:compileBikroyDebugNdk UP-TO-DATE :saltside-android:compileBikroyDebugSources :saltside-android:mergeBikroyDebugShaders :saltside-android:compileBikroyDebugShaders :saltside-android:generateBikroyDebugAssets :saltside-android:mergeBikroyDebugAssets :saltside-android:processBugsnagBikroyDebugProguard :saltside-android:transformClassesWithJarMergingForBikroyDebug :saltside-android:transformClassesWithMultidexlistForBikroyDebug :saltside-android:transformClassesWithDexForBikroyDebug ----- End of the daemon log ----- : FAILURE: Build failed with an exception. : * What went wrong: Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed) : * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I already increased memory and disabled daemon in gradle.properties like this

    org.gradle.jvmargs=-Xmx4608m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=false

Any body know what can be solution for it?

like image 716
imran ali Avatar asked Oct 27 '17 07:10

imran ali


1 Answers

I got solution but still writing answer so that if any body have same problem and can solve it. It was due to memory size of docker container, I am using mac and looks like issue is with mac machine only. On mack by default container size was 2GB, you can check on docker container with free command. so increase it to 4GB or more, boom it will solve your problem.

Docker->Preferences->Advanced->Memory

Click on Preferences

Increase Memory

like image 116
imran ali Avatar answered Nov 14 '22 23:11

imran ali