New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: API 31 support #1410
feat!: API 31 support #1410
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1410 +/- ##
=======================================
Coverage 73.20% 73.20%
=======================================
Files 21 21
Lines 1646 1646
=======================================
Hits 1205 1205
Misses 441 441
Continue to review full report at Codecov.
|
* feat(breaking): API 31 support * ci: bump actions/setup-java@3 w/ java 11 * ci: set setup-java distribution to adopt Co-authored-by: Erisu <erisu@apache.org>
Thanks for v11 💯 !! Just to let you know that the
Details:
Workarounds (see their issue tracker):
|
@ath0mas Have you tried setting the <preference name="AndroidGradlePluginVersion" value="7.0.1" /> Then run CLI command: This will update the I guess it depends on the use case, but I think the above config is enough for most cases? |
@erisu You are correct, your solution works great too! Thanks 👍 I was not aware of this preference as it is not documented. |
I wasn't aware there can be some restrictions in the gradle version + android studio, I figured they'd support at least a given major with any minor/patch version. Thanks for the compatibility table, this is definitely good to know. Regarding the preferences, yah there are a number of preferences that was added (back in v10 if I recall correctly) without actually being documented. Some of these preferences will very likely break builds if you use something other than the default configured. Cordova is only ever tested against the default configuration for build tools, AGP version, etc... I think we can document these but I think some of these new preferences needs to be stressed that they are for advanced usage / cordova development only I'll create a issue on the docs repo as a reminder. Eventually I'll get to it, if someone else doesn't get to it first. PRs are welcome. |
* feat(breaking): API 31 support * ci: bump actions/setup-java@3 w/ java 11 * ci: set setup-java distribution to adopt Co-authored-by: Erisu <erisu@apache.org>
Platforms affected
Android
Motivation and Context
Changes necessary to support API 31.
Description
Version updates:
SDK Version 30 -> 31
Gradle 7.1.1 -> 7.4.2
AGP 4.2.2 -> 7.1.0
Build Tools 30.0.3 -> 31.0.0
Testing
Ran hello cordova app in emulator. Ran npm test successfully.
Other remarks
To test this PR, requires the following changes:
With AGP 7.x, Java 11 is now required. Ensure that
JAVA_HOME
is set to a jdk 11 path andPATH
has jdk binaries.Further instructions assumes that you have
ANDROID_SDK_ROOT
path set appropriately. If you still use the olderANDROID_HOME
, then$ANDROID_SDK_ROOT
should be substituted with$ANDROID_HOME
With this change,
cmdline-tools
package is required. I tesed withcmdline-tools
6.0. If you attempt to use the old tools from$ANDROID_SDK_ROOT/tools/bin
, it will crash. You will need to add$ANDROID_SDK_ROOT/cmdline-tools/<version>/bin
to yourPATH
variable.If you have
$ANDROID_SDK_ROOT/tools/bin
path in yourPATH
variable, it should be removed.API 31 requires build tools 31. Use Android Studio's SDK Manager to install build tools 31.0.0. And ensure that
$ANDROID_SDK_ROOT/build-tools/31.0.0
is in yourPATH
variable.These things probably should be mentioned in our release announcement.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)