-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Build] Update Gradle to 7.4.2 & AGP to 7.2.1 #24
Conversation
Release Notes: https://docs.gradle.org/7.4.2/release-notes.html Command: ./gradlew wrapper --gradle-version=7.4.2
Release Notes: https://developer.android.com/build/releases/ past-releases/agp-7-2-0-release-notes This update also fixes the below build failure: ------------------------------------------------------------------------ > Task :well-sample:processDebugMainManifest FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':well-sample:processDebugMainManifest'. > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @28a15d52 ------------------------------------------------------------------------
This also fixes the below 'AndroidX' related warning with 'android.enableJetifier=true'. This behavior will not be allowed in Android Gradle plugin 8.0. ------------------------------------------------------------------------ > Task :well-sample:compileDebugJavaWithJavac ... > Configure project :wellsql ... WARNING:Your project has set `android.useAndroidX=true`, but configuration `:well-sample:debugRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues. This behavior will not be allowed in Android Gradle plugin 8.0. Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/ androidx/migrate for more info). The following legacy support libraries are detected: :well-sample:debugRuntimeClasspath -> project :wellsql -> com.android.support:support-annotations:28.0.0 > Task :wellsql:generateDebugRFile UP-TO-DATE WARNING:Your project has set `android.useAndroidX=true`, but configuration `:wellsql:debugRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues. This behavior will not be allowed in Android Gradle plugin 8.0. Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/ androidx/migrate for more info). The following legacy support libraries are detected: :wellsql:debugRuntimeClasspath -> com.android.support:support-annotations:28.0.0 > Task :well-sample-addon:generateDebugRFile UP-TO-DATE WARNING:Your project has set `android.useAndroidX=true`, but configuration `:well-sample-addon:debugRuntimeClasspath` still contains legacy support libraries, which may cause runtime issues. This behavior will not be allowed in Android Gradle plugin 8.0. Please use only AndroidX dependencies or set `android.enableJetifier=true` in the `gradle.properties` file to migrate your project to AndroidX (see https://developer.android.com/jetpack/ androidx/migrate for more info). The following legacy support libraries are detected: :well-sample-addon:debugRuntimeClasspath -> project :wellsql -> com.android.support:support-annotations:28.0.0 ------------------------------------------------------------------------
This is done for exactly the same reason, to remove any references of non 'AndroidX' dependencies from this project.
This is done to temporarily make Lint build success, even though the current this project points to 'targetSdkVersion 29', which is no longer supported, see below: ------------------------------------------------------------------------ Explanation for issues of type "ExpiredTargetSdkVersion": As of the second half of 2018, Google Play requires that new apps and app updates target API level 26 or higher. Configuring your app to target a recent API level ensures that users benefit from significant security and performance improvements, while still allowing your app to run on older Android versions (down to the minSdkVersion). To update your targetSdkVersion, follow the steps from "Meeting Google Play requirements for target API level", https://developer.android.com/distribute/best-practices/develop/ target-sdk.html https://support.google.com/googleplay/android-developer/answer/ 113469#targetsdk https://developer.android.com/distribute/best-practices/develop/ target-sdk.html
Since the are no unit tests written for this project, there is no point in supporting a unit test related configuration. Supporting that adds an additional level of maintenance that is not really necessary for this project at this point of time. PS: The only test written for this project is this 'WellSqlTest' UI related test.
Release Notes: https://developer.android.com/jetpack/androidx/releases/ annotation#version_120_5 ------------------------------------------------------------------------ FYI: Having a newer version of 'androidx.annotation:annotation' creates some non-fatal Kotlin 'META-INF' related errors (see below), which is better to avoid at this point of time, that is, until both 'androidx.appcompat:appcompat', 'androidx.annotation:annotation' and any other library that utilized Kotlin it updated accordingly. PS: The newest 'annotation' version (currently '1.6.0') add this extra 'annotation-jvm', which is the one bringing this new Kotlin '1.8.0' version in. ------------------------------------------------------------------------ > Task :wellsql:extractReleaseAnnotations e: /Users/.../annotation-jvm-1.6.0.jar!/META-INF/ annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0. e: /Users/.../kotlin-stdlib-1.8.0.jar!/META-INF/ kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0. e: /Users/.../kotlin-stdlib-1.8.0.jar!/META-INF/ kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0. e: /Users/.../kotlin-stdlib-1.8.0.jar!/META-INF/ kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0. e: /Users/.../kotlin-stdlib-common-1.8.0.jar!/META-INF/ kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0. ------------------------------------------------------------------------ Also, this is done to make sure that both, the 'annotation' and 'appcompat' (version '1.3.1') dependencies point to a version of 'annotation' that is close to each other.
This is done because otherwise the CI build fails during the 'Publish :wellsql' step with the below execution failure: ------------------------------------------------------------------------ > Task :wellsql:generateReleaseRFile FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':wellsql:generateReleaseRFile'. > Configuration `:wellsql:releaseRuntimeClasspath` contains AndroidX dependencies, but the `android.useAndroidX` property is not enabled, which may cause runtime issues. Set `android.useAndroidX=true` in the `gradle.properties` file and retry. The following AndroidX dependencies are detected: :wellsql:releaseRuntimeClasspath -> androidx.annotation:annotation:1.6.0 :wellsql:releaseRuntimeClasspath -> androidx.annotation:annotation:1.6.0 -> androidx.annotation:annotation-jvm:1.6.0 ------------------------------------------------------------------------
Yeap, this is in my todo list. However, it feels like the more I work the longer my todo list has been getting, so not sure what's happening there 😅 |
I feel you @oguzkocer ! 😅 PS: This ever-growing todo list of mine is staring at me too! 🙄 🤷 🛒 |
Thank you for reviewing and testing this @oguzkocer , you rock! 🙇 ❤️ 🚀 |
This PR upgrades Gradle to 7.4.2 and AGP to 7.2.1.
FYI: This PR also relates to this FluxC #2766 PR and the fact that the
com.android.support
group dependency had to be excluded from thewellsql
dependency to get the project to build withoutAndroidX
andandroid.enableJetifier=true
related warnings (see PR and commit description).PS: In addition to this Gradle and AGP upgrade, the below changes were added in order to align this repo with the rest of such WordPress-Mobile Android library related repos.
Build List:
Lint List:
Test Restructure List:
Dependency Versions Refactor List:
To test:
./gradlew build
locally and verify that it is successful (see previous such update).I also noticed the below AGP
8.0
warning, which relates to the new publishing DSL. This is maybe something we need to look into for this and all other such library related repos that utilize such publishing functionality. Wdyt @oguzkocer ?