Android Convenience Image Moving to Java v11 on August 17th

There has been a lot of people asking for a Java/OpenJDK update in the Android Convenience Image for awhile now. Last month I posted a GitHub Issue discussing this change for August 2020, maybe sooner in July. Considering we’re already in July, we’re going to stick with an August date for this change, updating the image August 17th.

Testing this change

While not available today, we’ll have images you can use to test Android and OpenJDK v11 very soon. This will be our staging images though so my suggestion is to simply use them to test your CI builds for Java v11 support, not as production images to stay on forever.

Stay tuned to this post (there’s a dropdown to “watch” this topic below) or the GitHub Issue to see when these staging images are available.

Avoiding this Change

We will not be running multiple versions of the Android image so you can’t really avoid it long term. Java 8 support for many tools is actively being dropped so this change is going to be needed for many Android ecosystem tools. If by August 17th you are still not ready for this change, you could pin the specific Android image you are using, thus preventing the version of Java from being changed out from under you. Keep in mind, that freezes your image meaning there’ll be no updates at all to it. You can learn more about pinning an image here.

Questions? Please respond below.

How to Test

Testing images are now available for this change. Instead of using the circleci Docker Hub namespace that you would normally use for an image, you need to use ccistaging. For example:

Normal image with Java v8 Testing image with Java v11
circleci/android:api-30 ccistaging/android:api-30
circleci/android:api-29-node ccistaging/android:api-29-node
circleci/android:api-28-ndk ccistaging/android:api-28-ndk

The Changes

  1. The main change is a simple but significant one. The version of Java used has switched from v8 to v11. It’s useful to make sure your build pipeline still works the same (if not better) with this major Java version change. Java v11 is the next LTS version after v8 and now has complete support from Android Studio, which is why it was chosen.
  2. We now install sdkmanager and related via Android’s Command-Line Tools package instead of the deprecated SDK Tools package.

Reporting

If you run into issues with these testing images, please report them here or on this GitHub Issue.