Update AGP to 8.11.0#22043
Conversation
Generated by 🚫 Danger |
Project dependencies changeslist! Upgraded Dependencies
androidx.databinding:viewbinding:8.11.0, (changed from 8.7.3)tree-+--- androidx.databinding:viewbinding:8.7.3
++--- androidx.databinding:viewbinding:8.11.0
\--- project :libs:image-editor
- \--- androidx.databinding:viewbinding:8.7.3 (*)
+ \--- androidx.databinding:viewbinding:8.11.0 (*)Build environment changeslist+ New Dependencies
io.grpc:grpc-inprocess:1.69.1
io.grpc:grpc-util:1.69.1
- Removed Dependencies
com.android.tools.utp:android-test-plugin-host-retention-proto:31.7.3
! Upgraded Dependencies
androidx.databinding:databinding-common:8.11.0, (changed from 8.7.3)
androidx.databinding:databinding-compiler-common:8.11.0, (changed from 8.7.3)
com.android.application:com.android.application.gradle.plugin:8.11.0, (changed from 8.7.3)
com.android.databinding:baseLibrary:8.11.0, (changed from 8.7.3)
com.android.library:com.android.library.gradle.plugin:8.11.0, (changed from 8.7.3)
com.android.tools.analytics-library:crash:31.11.0, (changed from 31.7.3)
com.android.tools.analytics-library:protos:31.11.0, (changed from 31.7.3)
com.android.tools.analytics-library:shared:31.11.0, (changed from 31.7.3)
com.android.tools.analytics-library:tracker:31.11.0, (changed from 31.7.3)
com.android.tools.build:aapt2-proto:8.11.0-12782657, (changed from 8.7.3-12006047)
com.android.tools.build:aaptcompiler:8.11.0, (changed from 8.7.3)
com.android.tools.build:apksig:8.11.0, (changed from 8.7.3)
com.android.tools.build:apkzlib:8.11.0, (changed from 8.7.3)
com.android.tools.build:builder:8.11.0, (changed from 8.7.3)
com.android.tools.build:builder-model:8.11.0, (changed from 8.7.3)
com.android.tools.build:builder-test-api:8.11.0, (changed from 8.7.3)
com.android.tools.build:bundletool:1.18.1, (changed from 1.17.1)
com.android.tools.build:gradle:8.11.0, (changed from 8.7.3)
com.android.tools.build:gradle-api:8.11.0, (changed from 8.7.3)
com.android.tools.build:gradle-settings-api:8.11.0, (changed from 8.7.3)
com.android.tools.build:manifest-merger:31.11.0, (changed from 31.7.3)
com.android.tools.ddms:ddmlib:31.11.0, (changed from 31.7.3)
com.android.tools.layoutlib:layoutlib-api:31.11.0, (changed from 31.7.3)
com.android.tools.lint:lint-model:31.11.0, (changed from 31.7.3)
com.android.tools.lint:lint-typedef-remover:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-device-provider-ddmlib-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-device-provider-gradle-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-device-provider-profile-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-host-coverage-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-host-logcat-proto:31.11.0, (changed from 31.7.3)
com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.11.0, (changed from 31.7.3)
com.android.tools:annotations:31.11.0, (changed from 31.7.3)
com.android.tools:common:31.11.0, (changed from 31.7.3)
com.android.tools:dvlib:31.11.0, (changed from 31.7.3)
com.android.tools:repository:31.11.0, (changed from 31.7.3)
com.android.tools:sdk-common:31.11.0, (changed from 31.7.3)
com.android.tools:sdklib:31.11.0, (changed from 31.7.3)
com.android:signflinger:8.11.0, (changed from 8.7.3)
com.android:zipflinger:8.11.0, (changed from 8.7.3)
com.google.api.grpc:proto-google-common-protos:2.48.0, (changed from 2.17.0)
com.google.code.gson:gson:2.11.0, (changed from 2.10.1)
com.google.errorprone:error_prone_annotations:2.30.0, (changed from 2.28.0)
com.google.protobuf:protobuf-java:3.25.5, (changed from 3.22.3)
com.google.protobuf:protobuf-java-util:3.25.5, (changed from 3.22.3)
com.google.testing.platform:core-proto:0.0.9-alpha03, (changed from 0.0.9-alpha02)
commons-io:commons-io:2.16.1, (changed from 2.13.0)
io.grpc:grpc-api:1.69.1, (changed from 1.57.0)
io.grpc:grpc-context:1.69.1, (changed from 1.57.0)
io.grpc:grpc-core:1.69.1, (changed from 1.57.0)
io.grpc:grpc-netty:1.69.1, (changed from 1.57.0)
io.grpc:grpc-protobuf:1.69.1, (changed from 1.57.0)
io.grpc:grpc-protobuf-lite:1.69.1, (changed from 1.57.0)
io.grpc:grpc-stub:1.69.1, (changed from 1.57.0)
io.netty:netty-buffer:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-codec:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-codec-http:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-codec-http2:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-codec-socks:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-common:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-handler:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-handler-proxy:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-resolver:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-transport:4.1.110.Final, (changed from 4.1.93.Final)
io.netty:netty-transport-native-unix-common:4.1.110.Final, (changed from 4.1.93.Final)
io.perfmark:perfmark-api:0.27.0, (changed from 0.26.0)
org.bouncycastle:bcpkix-jdk18on:1.79, (changed from 1.77)
org.bouncycastle:bcprov-jdk18on:1.79, (changed from 1.77)
org.bouncycastle:bcutil-jdk18on:1.79, (changed from 1.77)
org.codehaus.mojo:animal-sniffer-annotations:1.24, (changed from 1.23)
org.jetbrains.kotlin:kotlin-reflect:2.1.20, (changed from 2.0.21)
org.jetbrains.kotlin:kotlin-stdlib:2.1.20, (changed from 2.1.10)
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.20, (changed from 2.0.21)
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20, (changed from 2.0.21)
org.ow2.asm:asm:9.7.1, (changed from 9.6)
org.ow2.asm:asm-analysis:9.7.1, (changed from 9.6)
org.ow2.asm:asm-commons:9.7.1, (changed from 9.6)
org.ow2.asm:asm-tree:9.7.1, (changed from 9.6)
org.ow2.asm:asm-util:9.7.1, (changed from 9.6)
org.tensorflow:tensorflow-lite-metadata:0.2.0, (changed from 0.1.0-rc2) |
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22043-62aff76 | |
| Commit | 62aff76 | |
| Direct Download | wordpress-prototype-build-pr22043-62aff76.apk |
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22043-62aff76 | |
| Commit | 62aff76 | |
| Direct Download | jetpack-prototype-build-pr22043-62aff76.apk |
Replace @TargetApi(VERSION_CODES.P) with @RequiresApi(VERSION_CODES.P) in SignatureUtils.kt to properly propagate API level requirements to callers as recommended by lint.
Replace manual SharedPreferences.edit() calls with KTX edit { } extension:
- Automatically handles editor creation and apply()
- More concise and idiomatic Kotlin code
- No functional changes, only syntax improvements
Files updated:
- JetpackFeatureOverlayShownTracker: 3 instances
- SelectedSectionManager: 1 instance
- SelectedTrafficGranularityManager: 1 instance
- UpdateNotificationSettingsUseCase: 1 instance
- GCMRegistrationWorker: 3 instances (already using KTX)
Replace View.visibility comparisons and assignments with isVisible property: - Cleaner syntax for visibility checks (view.isVisible vs view.visibility == View.VISIBLE) - Direct boolean assignment for showing/hiding views - No functional changes Files updated: - EventItemViewHolder: Both setting and reading visibility - PhotoPickerFragment: 2 visibility checks - ReaderExpandableTagsView: Filter operation using isVisible - MediaPickerFragment: Conditional visibility check - UiHelpers: Already using isVisible correctly
Replace manual transaction handling with KTX transaction { } extension:
- Automatically handles beginTransaction, setTransactionSuccessful, and endTransaction
- Ensures proper cleanup in finally block
- Maintains error handling with SQLException catches for boolean return functions
Files updated:
- ResolverUtility: 2 transaction blocks with proper error handling
- SavedInstanceDatabase: Simple transaction for reset operation
Replace manual canvas.save()/restoreToCount() with withSave { } extension:
- Automatically saves and restores canvas state
- Cleaner scoped canvas operations
- No functional changes to drawing behavior
Files updated:
- LineChartMarkerView: Chart tooltip drawing
- SubscribersChartMarkerView: Chart tooltip drawing
Replace Uri.parse() calls with toUri() extension function: - More idiomatic Kotlin syntax - Same functionality, just cleaner API - Note: EditPostActivity Uri.parse() kept due to nullable String handling Files updated: - MediaUriPager: Preview URIs - HelpActivity: FAQ URLs (2 instances) - FeedbackFormViewModel: Attachment URIs - FeedbackFormScreen: Placeholder URIs (2 instances) - AbstractAllowedUrlsWebViewNavigationDelegate: URL parsing - ImageManager: Multiple image loading URIs - WidgetUtils: Intent data URI - PreviewImageFragment: Image loading URI
Replace TextUtils.getTrimmedLength() with trimmedLength() extension: - Direct extension function on CharSequence - Same trimming behavior (removes trailing whitespace) - More idiomatic Kotlin File updated: - NoteViewHolder: Trimming notification subject text
Replace ColorDrawable constructor with toDrawable() extension: - Creates ColorDrawable from color int value - Cleaner and more idiomatic Kotlin - Same resulting drawable Files updated: - PreviewModeSelectorPopup: Background color drawable - ImageManager: Fallback error drawable from color resource
Replace menu.size() method call with size property: - KTX extension provides property access - More idiomatic Kotlin property syntax - Same functionality File updated: - PhotoPickerActionModeCallback: Check if menu is empty
Replace more Uri.parse() calls with toUri() extension function: - More idiomatic Kotlin syntax for URI creation - Same functionality as Uri.parse() for non-null strings - Consistent with previous toUri() conversions Files updated: - ActivityLauncherWrapper: Play Store URL parsing - VideoLoader: File path to URI conversion - DeviceMediaLoader: Media URI parsing - CardViewModelSlice: URL parsing (2 files) - PhotoPickerViewModel: URI construction - AztecImageLoader: Image URI parsing - AppPrefsWrapper: URL parsing - DownloadManagerWrapper: Download URI parsing - UriWrapper: Constructor URI parsing - AppReviewManager: Review URL parsing
Replace manual TypedArray handling with withStyledAttributes extension: - Automatically handles obtainStyledAttributes and recycle() - Scoped access to attributes within lambda - Cleaner resource management File updated: - ActionableEmptyView: Custom view attribute parsing
Replace Uri.parse() with toUri() extension for URI creation: - Consistent with other toUri() conversions - More idiomatic Kotlin syntax - Same functionality for content resolver queries File updated: - ContentResolverWrapper: Query URI construction
Replace View.visibility == View.GONE checks with isGone property: - Consistent with isVisible usage elsewhere - More readable boolean checks - Same functionality File updated: - DateSelectorViewUtils: Time zone visibility checks
Updates deprecated Uri.parse() calls to use the KTX extension for cleaner and more idiomatic code.
Modernizes styled attributes handling using KTX extension for automatic resource management and cleaner code.
Modernizes canvas state management using KTX extension for automatic restore handling and cleaner code.
Add proper exception logging for caught SQLException to comply with detekt rules and improve debugging.
- Replace Context.obtainStyledAttributes with withStyledAttributes KTX in UnifiedCommentListItemDecoration - Replace Menu.size() with Menu.size property in WPMainNavigationView Note: Uri.parse() calls in EditPostActivity and UriUtilsWrapper are left unchanged as they handle nullable strings which the KTX toUri() extension does not support.
Added baseline entries for Aligned16KB lint errors from native libraries that don't support 16KB page alignment. These errors will be addressed in a later PR by updating dependencies to versions that support 16KB alignment for better device compatibility. Libraries affected: - com.facebook.fbjni:fbjni:0.5.1 - com.facebook.react:react-android:0.73.3 - com.facebook.fresco:animated-gif:2.0.0 - com.facebook.react:hermes-android:0.73.3 - com.facebook.fresco:imagepipeline-native:3.1.3 - com.facebook.fresco:nativeimagefilters:3.1.3
Replaces Uri.parse() with String.toUri() extension and adds null safety check for matcher.group(1) result.
- Convert UriUtilsWrapper.parse() to use non-nullable String parameter - Replace Uri.parse() with String.toUri() KTX extension - Add null safety in GifMediaDataSource.toMediaItem() - Use mapNotNull to filter out invalid MediaItems
- Add proper Context and Resources mocks in test setup - Mock context.resources to return valid Resources object - Fixes NullPointerException in resource.toDrawable(context.resources)
Reverts database transaction KTX changes that broke existing tests. The KTX conversion changed exception handling behavior and return values, breaking test expectations for database failure scenarios.
UseKtx warning is suppressed because the transaction KTX extension doesn't provide sufficient control over transaction success/failure handling needed for the existing API contract. Manual transaction handling is required to return specific boolean values to callers like UserFlagsHelper.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22043 +/- ##
==========================================
+ Coverage 39.15% 39.29% +0.13%
==========================================
Files 2134 2143 +9
Lines 101271 101698 +427
Branches 15544 15597 +53
==========================================
+ Hits 39655 39958 +303
- Misses 58079 58187 +108
- Partials 3537 3553 +16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nbradbury
left a comment
There was a problem hiding this comment.
@oguzkocer Thanks for this PR! I smoke-tested the app and didn't find any issues. ![]()
|
@oguzkocer @nbradbury I'm encountering unexpected languages in I recall we reverted a previous AGP upgrade in #21917 due to this issue. Do you think my recent experience stems from this AGP upgrade? |
I did test it with Spanish and English (Having my phone in English but the app in Spanish and vice versa). Could you share any examples or steps to reproduce it? |
|
Oof, I'm stunned this is still an issue. I'm able to reproduce this:
@oguzkocer I hate to say this, but we'll need to revert the AGP 8.11.0 update. |
|
I'm testing with 43b0fb7. Screen recording
wp-android-languages.mov |
|
For additional context, my understanding is that we should await the resolution of the relevant issue before upgrading AGP. |
Yes, we should. It was a mistake to overlook this. |
|
Noting another relevant issue discussing the same subject. |
|
@dcalhoun Good find, I missed that other issue! The final comment on that mentions that this was fixed in the May AOSP update, so it's not strictly an AGP issue. Regardless, I don't think we can expect everyone to have installed that update, so it probably still makes sense for us to revert the change. |
Yeah, the issue does not occur on my Samsung Galaxy S20 running Android 13. So, it seems to be device/OS specific. |
|
Thank you all for reporting the issue and sharing extra context! I've started working on reverting the update. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
The PR is not deployed, so that's not possible. |






Summary
Updates Android Gradle Plugin from previous version to
8.11.0, addresses99new lint warnings, and fixes test failures introduced by dependency updates.Changes Made
Lint Configuration Updates
Aligned16KBerrors - These will be addressed once all dependencies support16KBpage size alignmentUseRequiresApiin generated Hilt filesUseKtxwarning inResolverUtility- KTX transaction extension doesn't provide sufficient control for existing boolean return API contractUseKtx Modernization
Uri.parse()toString.toUri()KTX extension across multiple filesEditPostActivityandGifMediaDataSourceUriUtilsWrapperto use non-nullableStringparameter with proper null checks at call sitesTest Fixes
AztecImageLoaderTest- Added properContextandResourcesmocks to preventNullPointerExceptionRiskiest Changes⚠️
Null Safety Behavior Changes
The most significant risk comes from null safety improvements that change method signatures and behavior:
UriUtilsWrapperParameter ChangeWordPress/src/main/java/org/wordpress/android/util/UriUtilsWrapper.ktparse(uriString: String?)→parse(uriString: String)nullparametersGifMediaDataSource.ktusingmapNotNullto filter invalidMediaItemsGifMediaDataSourceNull HandlingWordPress/src/main/java/org/wordpress/android/ui/mediapicker/loader/GifMediaDataSource.kttoMediaItem()now returnsMediaItem?and checks for null URLsEditPostActivityPattern MatchingWordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.kt?: continuefor null regex group results