# Addresses the warning at ":app:transformClassesWithDexForRelease" # To run dex in process, the Gradle daemon needs a larger heap. # It currently has approximately 871 MB. # For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. # To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties. # For more information see https://docs.gradle.org/current/userguide/build_environment.html # Later: hm, but it does seem to fail on some systems... # You can get errors # Error occurred during initialization of VM # Could not reserve enough space for 2097152KB object heap # even with latest JDK 1.8.0_101 on Windows 32-bit # on a system with 4 GB RAM... # org.gradle.jvmargs=-Xms2048M -Xmx2048M # To support Java 17, we need this: # https://github.com/fluttercommunity/flutter_workmanager/issues/287 # https://stackoverflow.com/questions/42667837/running-application-with-java-9-module-java-base-does-not-opens-java-io org.gradle.jvmargs=--add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED # Since Android Gradle 4.2.2 (was not necessary with 4.1.0) we need this, # otherwise we get errors like # # > This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry. # The following AndroidX dependencies are detected: androidx.lifecycle:lifecycle-runtime:2.3.1, androidx.core:core:1.7.0, androidx.concurrent:concurrent-futures:1.0.0, androidx.lifecycle:lifecycle-common:2.3.1, androidx.versionedparcelable:versionedparcelable:1.1.1, androidx.lifecycle:lifecycle-viewmodel:2.2.0, androidx.annotation:annotation-experimental:1.1.0, androidx.activity:activity:1.1.0, androidx.collection:collection:1.0.0, androidx.arch.core:core-runtime:2.1.0, androidx.lifecycle:lifecycle-livedata-core:2.2.0, androidx.arch.core:core-common:2.1.0, androidx.annotation:annotation:1.2.0, androidx.savedstate:savedstate:1.0.0, androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0 android.useAndroidX=true # Gradle deamon is automatically initialized since Gradle version 3.0 # (see https://docs.gradle.org/current/userguide/gradle_daemon.html) # but it prevents removing the castle-engine-output/android/project/ . # E.g. you cannot run "castle-engine package --os=android --cpu=arm" # again in the same directory, because it cannot remove the # "castle-engine-output/android/project/" at the beginning. # # It seems the current directory of Java (Gradle) process is inside # castle-engine-output/android/project/, and Windows and Linux don't allow to remove such # directory. # # - Windows: Doing "rm -Rf castle-engine-output/android/project/" (rm.exe from Cygwin) # also fails with # # rm: cannot remove 'castle-engine-output/android/project/': Device or resource busy # # - Linux: The same problem later happened on Linux (Jenkins unholy-society, # Android build in Docker). # These files # # castle-engine-output/android/project/\?/.gradle/daemon/8.0/registry.bin # castle-engine-output/android/project/\?/.gradle/daemon/8.0/registry.bin.lock # # remained, locked by the Gradle daemon, and prevented removing # castle-engine-output later. # # - Maybe related to # https://discuss.gradle.org/t/the-gradle-daemon-prevents-a-clean/2473/13 # https://github.com/gradle/gradle/issues/937 org.gradle.daemon=false