What JDK can I use to develop extensions that support Android 9 or 10?

Currently I’m running jdk1.8.0_221 which seems to be unable to build Android 9 and 10 code that can be located on the Android Developers site. How can I fix this?

1 Like

Do you have examples of code that won’t compile? Be wary of using newer Java language features as they won’t be able to run on older versions of Android. Note that our build servers still only use Java 8, so it’s possible that extensions you build if not backwards compatible will not be usable in the production system.

1 Like

Normally things from https://developer.android.com/reference/java/io/File or any other class that use SDK 29 and up won’t work.

1 Like

That’s expected. Our sources compile against and target SDK 28, so newer features added in SDK 29 won’t be usable from our base source tree. You may be able to get away with using a newer SDK by replacing the android.jar file in the lib/android subtree, but it might also have unintended consequences. We will be updating to target SDK 29 in Q2 of next year.

2 Likes