-
Notifications
You must be signed in to change notification settings - Fork 118
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] Upgrade Gradle to 8.2.1 and AGP to 8.1.0 #1051
[Build] Upgrade Gradle to 8.2.1 and AGP to 8.1.0 #1051
Conversation
Release Notes: https://docs.gradle.org/8.1.1/release-notes.html Command: ./gradlew wrapper --gradle-version=8.1.1 --distribution-type=all ------------------------------------------------------------------------ FYI: You will notice that the associated 'gradle-wrapper.jar', 'gradlew' and 'gradlew.bat' files are not updated. This is because of the breaking changes that this upgrade introduces, including the 'AGP' upgrade and its associated breaking changes (namespace, build option, etc). As such, this Gradle upgrade command is only half done. PS: When all the breaking changes are resolved, this Gradle command will be issued again, which should fully complete this upgrade.
Release Notes: https://developer.android.com/build/releases/ gradle-plugin#agp-8-0-2
This is an AGP version '8.0' breaking change that requires 'namespace' in module-level build scripts, see build failure below: ------------------------------------------------------------------------ FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Could not create an instance of type com.android.build.api.variant.impl.ApplicationVariantImpl. > Namespace not specified. Please specify a namespace in the module's build.gradle file like so: android { namespace 'com.example.namespace' } If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/ build/agp-upgrade-assistant for more information. ------------------------------------------------------------------------ Explanation: "You must set the namespace in the module-level 'build.gradle.kts' file, rather than the manifest file." For more info see: https://developer.android.com/build/releases/ gradle-plugin#namespace-dsl
This is an AGP version '8.0' breaking change that changes the build option default values, see build failure below: ------------------------------------------------------------------------ FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':stories'. > Failed to notify project evaluation listener. > com.android.builder.errors.EvalIssueException: Build Type 'debug' contains custom BuildConfig fields, but the feature is disabled. > Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component .DefaultSoftwareComponentContainer. ------------------------------------------------------------------------ > Task :app:compileDebugKotlin FAILED e: /Users/.../app/src/main/kotlin/org/wordpress/aztec/demo/ MainActivity.kt: (680, 21): Unresolved reference: BuildConfig FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner .GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details ------------------------------------------------------------------------ Explanation: "Starting with AGP 8.0, the default values for these flags have changed to improve build performance. AGP 8.0 doesn't generate 'BuildConfig' by default. You need to specify this option using the DSL in the projects where you need it." For more info see: https://developer.android.com/build/releases/ gradle-plugin#default-changes
Release Notes: https://docs.gradle.org/8.1.1/release-notes.html Command: ./gradlew wrapper --gradle-version=8.1.1 --distribution-type=all ------------------------------------------------------------------------ As per the previous 19e79dd commit and its description, this change is a follow-up upgrade, which fully completes this Gradle upgrade.
FYI: This was suggested automatically using the AGP upgrade assistant.
FYI: This was suggested automatically using the AGP upgrade assistant.
Warning Message: "When targeting Android 13 or higher, posting a permission requires holding the 'POST_NOTIFICATIONS' permission (usage from 'com.bumptech.glide.request.target.NotificationTarget') When targeting Android 13 and higher, posting permissions requires holding the runtime permission 'android.permission.POST_NOTIFICATIONS'."
Warning Message: "Permission exists without corresponding hardware <uses-feature android:name="android.hardware.camera" required="false"> tag" Explanation: "The <uses-permission> element should not require a permission that implies an unsupported large screen hardware feature. Google Play assumes that certain hardware related permissions indicate that the underlying hardware features are required by default. To fix the issue, consider declaring the corresponding <uses-feature> element with required="false" attribute."
Release Notes: https://docs.gradle.org/8.2.1/release-notes.html Command: ./gradlew wrapper --gradle-version=8.2.1 --distribution-type=all
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.
Looks good to me. Approving the PR pending testing.
Awesome @oguzkocer , thanks for adding JDK17 support to this repo, updating the FYI: I went ahead, marked this PR as |
Platform Request:
pdnsEh-13V-p2
Project Thread:
paaHJt-57Z-p2
This PR upgraded Gradle to 8.2.1 and AGP to 8.0.2.
FYI: The 8.1.1 Gradle upgrades had to happen in 2 parts (19e79dd and f60a051). This is because of the breaking changes that this upgrade introduces, including the
AGP
upgrade and its associated breaking changes (namespace, build option, etc).🚫 Blocked By:
Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
CI Failure
Breaking Change List:
AGP Upgrade Assistant List:
Lint Resolution List:
Lint Suppression List:
Associated clients
You can reference the
[Build] Upgrade Gradle to 8.1.1 and AGP to 8.0.2
PRs of the below associated clients for testing/verification purposes:To test
Merge instructions
Ready for review
.[PR] Not Ready for Merge
label.