Open yvant opened 3 weeks ago
Hi
The requirement for Java 17 actually comes from the Android Gradle Plugin, and this version of AGP is required because of the compile / build tools:
NOTE: Multiple Android build-tools folders exist, choosing the latest version (35.0.0 rc2) for packaging
Basically, the AIR SDK looks in your Android SDK folder to see what build tools are available, and always selects the latest ones.
We are looking at adjusting things so that either the tools version could be configurable, or so that we ignore the need for AGP 8.x if we're running on Java 11 still (there will be a warning emitted by AGP 7.x but - currently at least - it should still work).
thanks
Thanks for the quick answer. So my best option is to upgrade to java 17? I'm not really at ease with all the android environment / gradle etc.
Yes, the two choices currently would be:
C:\Users\Yvan\.airsdk\adt.cfg
to point to the JBR folder within Android Studio...)Thanks!
So in the end I updated to openjdk version "17.0.11" 2024-04-16 OpenJDK Runtime Environment Temurin-17.0.11+9 (build 17.0.11+9) to be able to build and the publish was successful. However, I recently got a mail from Google:
Upgrade your game to a newer com.google.android.play:core SDK version
com.google.android.play:core has added this note for core:1.8.3:
Update your Play Core Maven dependency to an Android 14 compatible version! Your current Play Core library is incompatible with targetSdkVersion 34 (Android 14), which introduces a backwards-incompatible change to broadcast receivers to improve user security. As a reminder, from August 31, Google Play requires all new app releases to target Android 14. Update to the latest Play Core library version dependency to avoid app crashes: https://developer.android.com/guide/playcore#playcore-migration
1 - What do I need to do to prevent this? 2 - Isn't it better to stick to java 11 and downgrade v34.x and v35.x Android SDK versions? 3 - Why was it ok to keep v34.x and v35.x Android SDK in AIR 50.x?
That's an interesting message and makes our choices a little more complex...
Just to answer the questions (well, the second/third ones): ADT has always looked at the available "build tools" folders that are in the Android SDK location, and picks up the last one. That "Multiple Android build-tools folders exist" came from the original Adobe code - but this is probably made more problematic by the fact we use the tools in this folder for the Gradle building. And this is where it then ends up with problems.
So our planned workarounds were: 1) If someone is running with Java 11 and we don't have a Java 17 installation in a known location, then we could ignore the suggested update to AGP 8.x, which means that we would be able to build the project even though there would be a warning about using compile version 34 using AGP 7.x.... 2) With an updated set of options in the App Descriptor file, we could allow someone to specify the build tools version to use, which means that you could say your app needs to compile with v33, and we'd then know that AGP7.x / Java 11 is fine to use (and there would be no warnings etc).
The challenge with what you're trying there is that approach 1 wouldn't work: we could build it fine with the warning from AGP, but you'd still hit this issue with the Play Core Maven dependency (I think). And that's then because of the build tools being v34, which we can't change without approach 2 (or see below...)
But to answer your first question .. ultimately you need to be building this app using compile SDK and target SDK settings of v33. For the targetSDK, that's something you can have in your app descriptor file (if you don't already?), so something to add to your manifestAdditions section such as: <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33"/>
To change the compile SDK version, you would need to ensure we don't find any of the other build tools. So e.g. if I go in Windows to %localappdata%\android\sdk\build-tools
I can see folders 31.00, 33.0.1, 33.0.2, 34.0.0 etc. If you remove the ones from 34 onwards (via Android SDK Manager) it should limit the compile version to 33. Alternatively if you want to just hide them from ADT, you can rename the source.properties
file that's inside each of the folders, cos that's what we inspect to find out the version details...
Hope that helps. We'll look at getting out a build with the "approach 1" in it, but are also going to be pushing out 51.1 soon which will have "approach 2" that should give more flexibility to it all...
Thanks for the detailled answer. I'll try to set up the targetSdkVersion to
Fingers crossed :-) At this point, it shouldn't really matter which Java version is used
Now that I thing about it, latest ANEs require <uses-sdk android:minSdkVersion="24" android:targetSdkVersion="34"/>
. How to handle this discrepancy?
Potentially there's a difference between the "compileSdk", "targetSdk" and build tools settings... which may mean that this could still be handled with an older version of the Android platform. But it perhaps depends on the exact requirements.
You mention here that the latest ANEs have a targetSdkVersion
requirement of 34, but your other ANE gave an error: Your current Play Core library is incompatible with targetSdkVersion 34
So probably you just need to update that one...?
Ultimately, as per the Google message, everything should start switching to Android 14 = API 34, for which you're meant to use an Android Gradle Plug-in of version 8 or higher, requiring Java 17.. if you do have things that are not compatible with those then - if you're pushing out via the Play Store - you may need to get updates for them...
thanks
I tried to update to AIR 51.0.1.3 from AIR 50.2.5.1, using FlashDevelop. I'm using openjdk version "11.0.22" 2024-01-16.
Here's the error message I got;
I'll try updating to java 17. But is it a requirement for AIR 51? Won't it bring additional issues?