Skip to content
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

RDMR-251 ::: Prepare our fork of cordova-android 13.0.0 #21

Merged
merged 12 commits into from
Sep 26, 2024

Conversation

andredestro
Copy link

This adds 12 commits above the 13.0.0 version from upstream:

Add extra test coverage for "escape strings.xml app name" (from our 11.0.0 fork)
Enable filter touch - on by default (from our 11.0.0 fork)
Fix error on cordova load error.html (from our 11.0.0 fork)
Re-introduce legacy Cordova splash screen logic (from our 11.0.0 fork)
Update CI for OutSystems requirements (from our 12.0.0 fork)
Phaseout usage of enableJetifier property (from our 12.0.0 fork)
Phaseout kotlin-android-extensions plugin (from our 12.0.0 fork)
Allow setting splashscreen version via preference (from our 12.0.0 fork)
Raise defaults for Android 14 (from our 12.0.0 fork)
Ensure Kotlin JVM target is 1.8 (from our 12.0.0 fork)
Update Android libraries (from our 12.0.0 fork)
Add missing property to Gradle task Wrapper (from our 12.0.0 fork)

andredestro and others added 12 commits September 4, 2024 11:29
Our fix is already integrated into upstream,
but we had a better test coverage internally.

This commit includes the extra test coverage.

References https://outsystemsrd.atlassian.net/browse/RNMT-5258
References https://outsystemsrd.atlassian.net/browse/RNMT-5730
References https://outsystemsrd.atlassian.net/browse/RNMT-6187
BREAKING CHANGE: This changes the default value of FilterTouchesWhenObscured

We had a customer asking for the addition of a configuration
to our Android’s manifest to prevent touches when the app is
obscured, as this was flagged by the google store as a
security issue.

Therefore, we should provide the ability for our customers to
add this specific configuration.

References https://outsystemsrd.atlassian.net/browse/RNMT-5303
References https://outsystemsrd.atlassian.net/browse/RNMT-5392
References https://outsystemsrd.atlassian.net/browse/RNMT-5730
References https://outsystemsrd.atlassian.net/browse/RNMT-6187
Fixes the application crashing when webview redirects to error screen.

This customisation has historically been in a patch in the template.
Since we now have a fork, all customisations should be in the fork.

References https://outsystemsrd.atlassian.net/browse/RNMT-1890
References https://outsystemsrd.atlassian.net/browse/RNMT-5730
References https://outsystemsrd.atlassian.net/browse/RNMT-6187
The changes made to splash screens in Cordova-android 11
are in line with the UX Google wants. Unfortunately, this removes
the support for custom full image splash screens altogether.

To keep the support for the new Splash Screen API provided
out of the box by Cordova but also support the full image splash
screens, we're reintroducing the removed code while keeping
the new logic as well.

So what does this do now?
- If no custom splash screens were provided and the
ShowSplashScreenSpinner preference is not enabled, only the
new Android splash is presented
- Otherwise, the Android splash is dismissed as ASAP and the
old experience is used
- The show() method is now available in the clobber once again,
because the old splash screen can still be re-shown (the new one
can't, hence why this method was removed)
- It's possible to dismiss the splash screen via hide() when using
AutoHideSplashScreen (this was possible before but was removed
in this new experience)

References https://outsystemsrd.atlassian.net/browse/RNMT-5730
References https://outsystemsrd.atlassian.net/browse/RNMT-6187
According to https://developer.android.com/jetpack/androidx/migrate,
this flag is no longer required -- and is in fact discouraged -- if
an Android project is no longer using any Support Libraries (i.e.,
fully migrated to AndroidX). This flag can can lead to slower build
times. The command `gradlew :app:checkJetifier` command can be used
to to confirm if it’s actually needed.

BREAKING CHANGE: as of this commit, it will no longer be possible to
use any Android Support Libraries, only AndroidX Libraries.

References https://outsystemsrd.atlassian.net/browse/RNMT-6192
According to https://android-developers.googleblog.com/2022/02/discontinuing-kotlin-synthetics-for-views.html
this Gradle plugin is no longer required, and will actually prevent
using newer Kotlin versions to build Android applications. This is
also reflected in apache#1642,
so staying one step ahead, this plugin has been effectively removed.

References https://outsystemsrd.atlassian.net/browse/RNMT-6192
BREAKING CHANGE: drops Android 8.1 and enables Kotlin by default.

References https://outsystemsrd.atlassian.net/browse/RNMT-6192
As per https://developer.android.com/build/jdks#target-compat, when
using Kotlin, the jvmTarget defaults to the toolchain version which,
if not explicit, is the JDK used by Gradle. Now that AGP 8 requires
JDK 17 (which is also embedded in the latest Android Studio version
[Giraffe as of this commit]), the default toolchain is effectively
JDK 17 and this is causing JVM target incompatibility when building
an application using both Java and Kotlin source code. The error is
something along the lines of:

 'compileDebugJavaWithJavac' task (current target is 1.8) and
 'kaptGenerateStubsDebugKotlin' task (current target is 17)
 jvm target compatibility should be set to the same Java version.

As per https://kotlinlang.org/docs/gradle-configure-project.html#what-can-go-wrong-if-not-checking-targets-compatibility
this incompatibility can arise when:

 - Have a default configuration, and your JDK is not equal to 1.8.

Since the build.gradle file is setting the Java source and target
compatibility to 1.8, this causes a mismatch with the new default
assumed by Kotlin's jvmTarget. There are two ways out of this:

 1. Raise the Java source and target compatibility values to 17 and
    do nothing about Kotlin's jvmTarget
 2. Explictly set Kotlin's jvmTarget to 1.8 and do nothing about
    Java source and target compatibility values

Point 2. was chosen because although supposedly Android 14 will
bring full support for Java 17 language features according to
https://developer.android.com/about/versions/14/summary, currently
any fresh project generated via Android Studio still sets version
1.8 for Java source and target compatibility, and actually lowers
Kotlin's jvmTarget to 1.8, meaning Google is not ready yet to fully
pull the trigger on Java 17, and neither should we.

References https://outsystemsrd.atlassian.net/browse/RNMT-6064
This propery should default to true, but for some reason Gradle is
complaining starting with version 8.6. As a result, the wrapper fails
to install the selected version. Possibly a bug in Gradle, but no harm
in adding this here (famous last words).

References https://outsystemsrd.atlassian.net/browse/RDMR-74
@andredestro andredestro self-assigned this Sep 19, 2024
@andredestro andredestro requested review from a team, markemer, EiyuuZack, Chuckytuh, carlpoole, Steven0351, usernuno, theproducer and jcesarmobile and removed request for a team September 19, 2024 09:21
Copy link

@markemer markemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems straightforward based on our changes to 12.

@andredestro andredestro merged commit 5153b80 into outsystems/13.0.x Sep 26, 2024
18 checks passed
@andredestro andredestro deleted the feat/RDMR-251/add-relevant-commits branch September 26, 2024 13:29
@andredestro andredestro restored the feat/RDMR-251/add-relevant-commits branch September 26, 2024 15:22
@andredestro andredestro deleted the feat/RDMR-251/add-relevant-commits branch September 30, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants