thyrlian / AndroidSDK

🐳 Full-fledged Android SDK Docker Image
Apache License 2.0
1.25k stars 219 forks source link

Support for Gradle 7.x and AGP 7.x #53

Closed neugartf closed 3 years ago

neugartf commented 3 years ago

AGP 7.x and Gradle 7.x updates will need JDK 11, thus we might want to start preparing a branch that supports JDK 11.

https://android-developers.googleblog.com/2020/12/announcing-android-gradle-plugin.html

thyrlian commented 3 years ago

Sure. We can think about several solutions:

Thanks Fabian :)

neugartf commented 3 years ago

I would suggest the ARG way and then publish two different images like they do here: https://github.com/alvr/alpine-android.

thyrlian commented 3 years ago

Sounds good, so far no better alternative solution.

thyrlian commented 3 years ago

Done. Now the default image is with JDK11, and the variant image android-sdk-jdk8 is with JDK8.

To pull the latest JDK11 image: docker pull thyrlian/android-sdk:7.0. Details can be found here.

thyrlian commented 3 years ago

README is updated as well:

Earlier in JDK 8, you need to set the environment variable _JAVA_OPTIONS to -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap. Then you'll see such logs like Picked up _JAVA_OPTIONS: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap during any task execution, which means it takes effect. JDK 10 has introduced -XX:+UseContainerSupport which is enabled by default to improve the execution and configurability of Java running in Docker containers. Since JDK 1.8.0_191, -XX:+UseContainerSupport was also backported, then you don't need to set -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap any more. UseCGroupMemoryLimitForHeap was deprecated in JDK 10 and removed in JDK 11.