-
Notifications
You must be signed in to change notification settings - Fork 137
Bump AGP to 8.5.1
#12042
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
Bump AGP to 8.5.1
#12042
Conversation
Starting from Gradle 8.4, shrinking at library level is now respected. Library modules will be now shrinked in isolation, removing code that might be used by other modules. The solution is to not shrink each library module (no need as we don't publish them in isolation) and shrink only app modules.
They're not used
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
To address `NotificationPermission` lint error. Actually, this permission is not needed at this moment, as the wear module doesn't use org.wordpress.android.util.AutoForeground or classes that overrides from it so it seems to be a false positive from lint. I don't want to suppress this issue though, as we might use AutoForeground in the future, and the POST_NOTIFICATIONS will be necessary then.
- unwrap `String#format(Context#getString` calls. Having two formats is unnecessary and can be confusing - update format arguments to reflect type declared in strings.xml
|
|
||
| <uses-permission android:name="android.permission.INTERNET" /> | ||
| <uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
| <uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> |
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.
I think it's a false positive: the WooCommerce-Wear doesn't use AutoForeground or any service that is inheriting from it.
I've experimented with removing org.wordpress:utils dependency from WooCommerce-Wear module and running lint was resulting with no errors.
To make sure there are no new services, I've compared manifests of WooCommerce-Wear with and without org.wordpress:utils. The diff is:

which is not relevant to POST_NOTIFICATIONS.
My conclusion: Android linter detects AutoForeground service in dependencies of the WooCommerce-Wear module and throws this lint error, not minding that we don't actually use the service.
I decided to add this permission anyway, as it's already present in WooCommerce module and I didn't want to suppress this warning, in case that we'll indeed need posting a notification from the wear app.
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.
Only now I realised that we already request POST_NOTIFICATIONS in a few places in the app
woocommerce-android/WooCommerce/src/main/kotlin/com/woocommerce/android/util/WooPermissionUtils.kt
Lines 59 to 62 in e7e9368
| @RequiresApi(VERSION_CODES.TIRAMISU) | |
| fun requestNotificationsPermission(launcher: ActivityResultLauncher<String>) { | |
| launcher.launch(POST_NOTIFICATIONS) | |
| } |
POST_NOTIFICATION in manifest is more of a correctness (as signilised by lint warning)edit: yes, we use but in WooCommerce module, not WooCommerce-Wear
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #12042 +/- ##
============================================
+ Coverage 39.99% 40.04% +0.05%
+ Complexity 5525 5505 -20
============================================
Files 1200 1200
Lines 68416 68295 -121
Branches 9577 9369 -208
============================================
- Hits 27364 27350 -14
+ Misses 38492 38445 -47
+ Partials 2560 2500 -60 ☔ View full report in Codecov by Sentry. |
|
hi @kidinov 👋 can I request your assistance in smoke testing |
ParaskP7
left a comment
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.
👋 @wzieba !
I have reviewed and tested this PR as per the instructions, everything works as expected, good job! 🌟
I have left a single suggestion (💡) comment for you to consider. I am NOT going to approve this PR (for now), leaving the final approval to @kidinov instead (context). No matter, everything worked as expected for me so I can tentatively approve as well if you need me to (just let me know).
EXTRAS
- Warning (
⚠️ ): When this PR get merged intotrunkdev will need to use AS Koala. AGP 8.5.0 is incompatible with previous versions of AS and thus devs wouldn't be able to (for example) sync the project otherwise (see Android Studio & AGP compatibility options).
|
hi @malinajirka ! 👋 can I have your assistance regarding smoke testing I don't have a store with the correct setup, so I think it'll be more efficient if someone from Woo could test it. |
malinajirka
left a comment
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.
Hi @wzieba 👋
👋 can I have your assistance regarding smoke testing iap and cardreader modules? The changes introduced with AGP 8.4.0 are related to obfuscating library modules, so I'd like to make sure we don't introduce regression.
I've tested the card reader flows and I haven't noticed any regression.
With the removal of Site Creation in the app, the IAP flows are not used at the moment.
|
Gotcha, thank you @malinajirka ! 🙌 |
|
Found 1 violations: The PR caused the following dependency changes:expand
-+--- androidx.databinding:viewbinding:8.1.0
++--- androidx.databinding:viewbinding:8.5.1
+--- project :libs:cardreader
| \--- com.stripe:stripeterminal-localmobile:3.1.1
-| \--- androidx.databinding:viewbinding:7.4.2 -> 8.1.0 (*)
+| \--- androidx.databinding:viewbinding:7.4.2 -> 8.5.1 (*)
\--- org.wordpress:mediapicker:0.3.1
- \--- androidx.databinding:viewbinding:8.1.0 (*)
+ \--- androidx.databinding:viewbinding:8.1.0 -> 8.5.1 (*)
Please review and act accordingly
|

Description
This PR updates Android Gradle Plugin to 8.5.0, mostly needed to address security vulnerabilities.
Testing information
releaseVanillavariant as there are changes related to R8.iapandcardreaderDependencies
Bump AGP to
8.5.1wordpress-mobile/WordPress-FluxC-Android#3065Bump AGP to
8.5.1wordpress-mobile/WordPress-Android#21082Bump AGP to
8.5.1WordPress/gutenberg#64044I have considered if this change warrants release notes and have added them to
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.