Looking at the AOSP build log I can see that it is trying to compile the app using the following javac command:
out/soong/host/linux-x86/bin/soong_javac_wrapper prebuilts/jdk/jdk9/linux-x86/bin/javac -J-Xmx2048M -Xmaxerrs 9999999 -encoding UTF-8 -sourcepath "" -g -XDskipDuplicateBridges=true -XDstringConcat=inline -bootclasspath "" -classpath prebuilts/sdk/system_current/android.jar:out/soong/.intermediates/external/guava/guava/android_common/turbine-combined/guava.jar -source 1.8 -target 1.8 ... If I manually change the source and target parameters to 1.9 and execute the javac build command, the app is compiled successfull. Does anyone know how to change this SDK to 1.9 so that the full AOSP build uses it? Thank you, Donal On Sunday, April 26, 2020 at 6:33:54 PM UTC+1, Donal Morrissey wrote: > > Hi There, > I'm trying to *backport* the *updater_sample* system app to a platform > build running *Android 9 / API 28*. This updater_sample app uses advanced > Java features such as lambda functions which are not supported in the JDK > of the platform build. So the platform build is failing when it attempts to > compile the backported app. > > If I was compiling the app via Android Studio I would add something like > the following to the gradle config file: > > android { > compileOptions { > // change compatibility to Java 8 to get Java 8 IDE support > sourceCompatibility JavaVersion.VERSION_1_8 > targetCompatibility JavaVersion.VERSION_1_8 > } > > But I'm not sure where to add this in the platform build. > > Is there a way to configure the build of this system app in the platform > build (perhaps via its Android.bp file) to use the JDK 1.8? > > Thank you, > Donal > > > The content of this e-mail, including any attachments it may contain, is > intended only for the recipient(s) named above. It may contain information > that is confidential, subject to copyright, or otherwise legally protected > against disclosure. If you have received this e-mail in error please notify > the author and delete it from your system. -- The content of this e-mail, including any attachments it may contain, is intended only for the recipient(s) named above. It may contain information that is confidential, subject to copyright, or otherwise legally protected against disclosure. If you have received this e-mail in error please notify the author and delete it from your system. -- -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting --- You received this message because you are subscribed to the Google Groups "android-porting" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/f7c17a4a-849a-4fae-8f98-303a3ab81f35%40googlegroups.com.