-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 34 Support #1678
feat!: API 34 Support #1678
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1678 +/- ##
==========================================
+ Coverage 72.15% 72.50% +0.35%
==========================================
Files 23 23
Lines 1839 1837 -2
==========================================
+ Hits 1327 1332 +5
+ Misses 512 505 -7 ☔ View full report in Codecov by Sentry. |
9a0d6b7
to
1538546
Compare
1538546
to
47ba3bd
Compare
47ba3bd
to
4ce8d08
Compare
From upstream (apache#1678): Gradle -b flag This flag has been deprecated and scheduled to be removed in gradle's next major release. The gradle projects must follow a standard structure now. Cordova's generated project already follows the standard structure thus for cordova build commands the -b append can simply just be removed, we don't need to explicitly declare the build.gradle file. It was also used against the wrapper.gradle file which changes are noted below. gradle.wrapper The "intentionally empty" gradle.wrapper file has been removed. We no longer manually manage gradle versions. Instead, we let gradle do it for us by utilising their --gradle-version argument. A new function was introduced to replace the old runGradleWrapper to: setup the gradle wrapper if not already present install/update the gradle wrapper to the specified version. By default, this will be 8.4 as defined in the defaults json config file, but may be overwritten by GradleVersion preference, or CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL environment variable. If CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL is defined, the preference will be ignored and --distribution-url will be used instead, maintaining the ability for corporations to install their own gradle wrapper from their own source. References https://outsystemsrd.atlassian.net/browse/RNMT-6402
From upstream (apache#1678): Gradle -b flag This flag has been deprecated and scheduled to be removed in gradle's next major release. The gradle projects must follow a standard structure now. Cordova's generated project already follows the standard structure thus for cordova build commands the -b append can simply just be removed, we don't need to explicitly declare the build.gradle file. It was also used against the wrapper.gradle file which changes are noted below. gradle.wrapper The "intentionally empty" gradle.wrapper file has been removed. We no longer manually manage gradle versions. Instead, we let gradle do it for us by utilising their --gradle-version argument. A new function was introduced to replace the old runGradleWrapper to: 1. setup the gradle wrapper if not already present 2. install/update the gradle wrapper to the specified version By default, this will be 8.4 as defined in the defaults json config file, but may be overwritten by GradleVersion preference, or CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL environment variable. If CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL is defined, the preference will be ignored and --distribution-url will be used instead, maintaining the ability for corporations to install their own gradle wrapper from their own source. References https://outsystemsrd.atlassian.net/browse/RNMT-6402
b756804
to
24b72b5
Compare
The mapping is pretty straightforward: AndroidJavaSourceCompatibility > Java Source Files - defaults to (Java) 8 AndroidJavaTargetCompatibility > Java Compiler - defaults to (Java 8 AndroidKotlinJvmTarget > Kotlin Compiler - defaults to '1.8' AndroidJavaTargetCompatibility and AndroidKotlinJvmTarget should target the same semantic Java version to avoid build conflicts due to different JDKs. Only sane defaults are provided, no further checks are performed. See apache#1678 for more info. References https://outsystemsrd.atlassian.net/browse/RNMT-6402
24b72b5
to
c599d50
Compare
de2f1f3
to
0a1f947
Compare
4da5144
to
8490c88
Compare
I've updated the wording, also added a smaller Breaking Changes section that highlights in short bullet-form of the notable breaking changes. |
API 34: Upgrade AGP from 8.2.0-rc01 to 8.2.0-rc02 API 34: Upgrade AGP from 8.2.0-rc02 to 8.2.0-rc03 API 34: Upgrade AGP from 8.2.0-rc03 to 8.2.0 feat: add AndroidKotlinJVMTarget preference to set the kotlin JVM target This is in addition to the java source / target compatibility preferences. AndroidKotlinJVMTarget is only affective if Kotlin is enabled. chore: Upgrade Gradle from 8.4 to 8.5 AGP 8.2.0 -> 8.2.1 Gradle 8.5 -> 8.7 fix: Add --validate-url to gradle wrapper commands AGP 8.4.0
The new default value is null. When null, it will by default to the Java Target compatibility. Updating AndroidJavaTargetCompatibility will also influence the Kotlin JVM target, unless if AndroidKotlinJVMTarget is also explicitly defined.
I've reverted AGP down to 8.3 Jellyfish appears to bundle Gradle 8.4 by default and will fail on installing the wrapper due to AGP 8.4's requirement on Gradle 8.6. In order to use AGP 8.4 on Jellyfish, the user would have to do additional configurations to specify an alternate gradle. |
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
I have tested the following:
cordova platform add
cordova build android
- Android Studio Jellyfish
- Gradle Sync
- Build and Run on Emulator
I confirmed that Gradle 8.7 and AGP 8.3 is used.
…eded). apache/cordova-android#1678 Added kotlin version etc. Removing splash files, after they are not longer supported with android
* #704, #705 Add third wave water profiles, and make water section like the preparation methods, to add a specific or custom one. * We removed in lokalise all old translations to make some more cleanup. * Preset third wave water translations * Changed font size * Resetting smoothedValue when attaching to the scale flow * #709, #708, #707, #706 Added haptic engine added text to speech for bluetooth scale connection added sort of images added indicator that machines are connected * #710 - toggle hour and minutes * #711 - Enable tare again on brew timer start when pressure or temperature threshold is hit cause of logic changes * #712 - Unarchive a bean * #713 - Focus seconds directly when opening the timer * #714 - Save again the brew when the while brewing is shown * #715 - Send EY to visualizer * Adding Bookoo devices * Adding translations * Corrected identifier name, testDeviceScan corrected, aswell as searching the pressure devices to find the bookoo pressure * Swiching to nativestorage back * Removing splash screens * Removing splash screen plugin, upgrading to android 13 (jdk 17 now needed). apache/cordova-android#1678 Added kotlin version etc. Removing splash files, after they are not longer supported with android * Making text to speech just for IOS possible, aswell as fixing android image choosing with new version update * update text * Removed unused function * Made extraction chart labels translatable (#718) Co-authored-by: Lars Saalbach <[email protected]> * Fix typos in Spanish translation (#716) * update text * Added first 7.3.0 update texts * outcomenting the bookoo pressure * Add new functions for starting Value Transmission * Use Value Transmission functions depending on timer * Commiting the pressure changes for the booko * Fixing the meticulous API data :) * Adding the strip android permissions, specialy for write storage aswell for: android.permission.BODY_SENSORS android.permission.ACTIVITY_RECOGNITION * Fix pin formater for beans * Set final weight for meticulous * Updating 7.3 patchnotes * Fixing to the next version * Fixing iOS image selection * #721 - Adding download button for brew by weight & retrying the call to the xenia. * #721 - Fixing null value * Lokalise update (#724) * Fixings the MA_STATUS Wait, and wait 2 seconds. Changing the notes and aromatics to the bottomline * Lokalise update (#725) * Lokalise update (#727) * Enabling pressure sensor, updating to 7.3.0 version tag * Fix tests after master merge. * Everywhere: Add missing decalations, imports and providers. * water-information-card: Add a water.type so Water.getIcon returns. * app.component: Remove Platform spy because it was missing is function * #736 - Removing the plugin cause of the core dependency * Add missing OnDestroy to BrewAddComponent. (#738) Original fix in b9ffb35 by AdrisGithub. ngOnDestroy added in 5538f04. * Remove duplicate text in README.md (#729) Duplicate text aded in 9d05b7c Co-authored-by: Grapehfruit <[email protected]> * Split beforEach calls into async and sync calls. compileComponents is async so it needs to be in a waitForAsync block. The actual component creation should be in a sync block. Reference: https://angular.dev/guide/testing/components-scenarios#calling-compilecomponents * Delete unused import. setParseTemplateAsSourceFileForTest * Uncomment CuppingRadarComponent test. Register chart.js components in the same way as is done in app.component.ts * Revert changes to plotly.min.js. This file is imported, it shouldn't have been re-formatted. * Fix and uncomment graph-display-card.component.spec.ts. Split beforEach in async and sync. Clean up formatting. * UnComment and fix BrewBrewingGraphComponent test. * Create a MockBrew class that extends Brew and stubs out reading the Preparation from storage. * Provide MockBrew instance as `data` input. * In BrewBrewingGraphComponent.getPreparation, delegate to this.data.getPreparation insteda of re-implementing reading from storage. This allows for stubbing the storage read in a single palce. * Split beforeEach in async and sync sections ref: https://angular.dev/guide/testing/components-scenarios#calling-compilecomponents --------- Co-authored-by: Grapehfruit <[email protected]> Co-authored-by: randomcoffeesnob <[email protected]> Co-authored-by: agubelu <[email protected]>
Hello, Does Cordova support Android 14? I saw you were working on it (api34-support), but didn't see any update on the oficial documentation here https://cordova.apache.org/docs/en/12.x/guide/platforms/android/index.html ? |
Yes. See here for more details. |
Platforms affected
Android
Motivation and Context
Adds in support for the next android platform
Closes #1661
Closes #1596
Description
This PR supercedes and includes #1596
This PR does a few different things to provide API 34 support which will be noted below.
Breaking Changes
These are notable changes that is breaking that may affect plugins or workflows. It doesn't highlight all breaking changes in which were hidden inside implementation details.
Default Configuration Changes
Target SDK: 34
Gradle Version: 8.7
AGP Version: 8.3.0
Kotlin JVM Target: 1.8 (If kotlin is enabled)
Min Build Tools: 34
Java/Kotlin Changes
Source/Target compatibility we changed from Java 8 to 17 on both the framework and app template projects.Source & Target compatibility have been reverted back to 8, but 2 new preferences are added to allow developers to experiment:
AndroidJavaSourceCompatibility
andAndroidJavaTargetCompatibility
which adjusts the respective gradle compile options. By default, these values are 8, which is the same values used before.Additionally,
AndroidKotlinJVMTarget
preference was added to select the Kotlin JVM target. By default, the Kotlin JVM Target will be same asAndroidJavaTargetCompatibility
. Updating AndroidJavaTargetCompatibility will influence the Kotlin JVM target unless ifAndroidKotlinJVMTarget
is also explicitly defined.BuildConfig
Previously this I believe was implicitly enabled, but now needs to be explictly enabled otherwise the following may occur
I however did not encounter this on a simple project, so it might be required depending on what the plugins does.
AGP 8.3
AGP 8.2 is the minimum version required for API 34 builds. Attempting build against API 34 on earlier versions will produce warnings and/or errors.
AGP 8.3 is however the latest version that can be used with standard Android Studio configurations.
AGP 8.4 was tested with and will mostly work, but will not work inside Android Studio without further configuration. Because we don't want to impose Android Studio configurations onto the user, AGP 8.3 is chosen for cordova-android@13 release.
Gradle
-b
flagThis flag has been deprecated and scheduled to be removed in gradle's next major release.
The gradle projects must follow a standard structure now. Cordova's generated project already follows the standard structure thus for
cordova build
commands the-b
append can simply just be removed, we don't need to explicitly declare thebuild.gradle
file.It was also used against the
wrapper.gradle
file which changes are noted below.gradle.wrapper
The "intentionally empty" gradle.wrapper file has been removed.
We no longer manually manage gradle versions. Instead, we let gradle do it for us by utilising their
--gradle-version
argument. A new function was introduced to replace the oldrunGradleWrapper
to:By default, this will be
8.7
as defined in the defaults json config file, but may be overwritten byGradleVersion
preference, orCORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
environment variable.If
CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL
is defined, the preference will be ignored and--distribution-url
will be used instead, maintaining the ability for corporations to install their own gradle wrapper from their own source.The Gradle Wrapper was previously checked into the repo and was removed. It has since returned as using the system gradle to generate the wrapper caused issues. Namely it would require end-users to have an appropriate gradle version that satisfies AGP, which kind of defeats the purpose of using wrappers.
Because
-b
flag will be going away, there is now atools
project that is templated and copies. This project serves as the oldwrapper.gradle
, in that it's an empty project that can be used by the system gradle of a varying version range to produce the gradle wrapper at the version that we need to build the android project.~obsolete gradle-wrapper notes~
This section is no longer in the PR
While personally I do not agree with how Gradle handles this, it is their recommendation to check in the Gradle wrapper, including the jar file into the source.
This done for both our test project and the app template. On platform add, the wrapper will be copied from the template. Individual projects via
GradleVersion
may change the wrapper version.Should the end user choose a gradle version below what was required by AGP, gradle will update the gradle version, but builds will fail. Attempting to update the version back to an acceptable version will cause the gradle wrapper task to fail as the wrapper task also loads in AGP. To avoid this, Cordova does a version check before executing the wrapper task and will not update the wrapper if it's below the minimum required.
Note that while by preference both Gradle Version and AGP versions are configurable, the version check is not. This means that even if you drop Gradle and AGP down a version, the current >= 8.6 check will remain. I think this is OK since these preferences are documented for internal development use.
Lastly, because of the introduction of using
--gradle-version
and letting gradle manage our wrappers, the clean gradle wrapper script we had for our test project became obsolete and was removed.Android Studio
With AGP 8.3, Android Studio Jellyfish will now be required for opening the native project.
CI
JDK was updated from 11 to 17, which is a requirement to build for API 34
Testing
Ran NPM test
Ran in sample cordova hello world app, with variety of different configurations
Ran in one of my projects
Known Issues
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)