Skip to content

[WOOMOB-3313] Update target SDK to Android 17 (API 37) - #16413

Open
AdamGrzybkowski wants to merge 5 commits into
trunkfrom
issue/increment-target-sdk-37
Open

[WOOMOB-3313] Update target SDK to Android 17 (API 37)#16413
AdamGrzybkowski wants to merge 5 commits into
trunkfrom
issue/increment-target-sdk-37

Conversation

@AdamGrzybkowski

@AdamGrzybkowski AdamGrzybkowski commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes WOOMOB-3313

Bumps targetSdkVersion from 36 to 37 (Android 17).

Behavior changes list at https://developer.android.com/about/versions/17/behavior-changes-17 don't affect our codebase.

The one item worth flagging for the Peacock team: the POS phone-as-reader flow does local-network discovery, which on Android 17 can use the ACCESS_LOCAL_NETWORK runtime permission directly. I intentionally did not add it. I verified on an API 37 device that the feature keeps working via Android 17's system-mediated device picker and nothing crashes without the permission. Adding the permission is purely a UX improvement (potentially, skips the system picker).

The seven new robolectric.properties files pin Robolectric to sdk=36 (its max supported level). Without them the many Robolectric tests that don't set @Config(sdk=...) inherit the bumped targetSdkVersion=37 and fail with targetSdkVersion=37 > maxSdkVersion=36; pinning keeps them on the same SDK they ran at before the bump. Follow-up to upgrade Robolectric to 4.17 (adds API 37 support) and drop these pins: WOOMOB-3849.

Test Steps

This is a targetSdk update, so it warrants a smoke pass of critical flows on an Android 17 (API 37) device/emulator:

  1. Log in — including a self-hosted / Jetpack-connected site — and confirm the store loads.
  2. Browse the order list, create an order, and view/edit a product.
  3. Take an in-person payment with a Bluetooth card reader or Tap to Pay.
  4. Open WooPOS on a tablet, connect a card reader, and complete a sale. (Phone-as-reader over Wi-Fi now goes through the Android 17 system device picker — connecting still works.)
  5. Confirm no crashes or regressions versus targetSdk 36.

Images/gif

N/A

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@AdamGrzybkowski AdamGrzybkowski added category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. type: technical debt Represents or solves tech debt of the project. labels Aug 13, 2026
@AdamGrzybkowski AdamGrzybkowski added this to the 25.5 milestone Aug 13, 2026
@wpmobilebot

wpmobilebot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Project manifest changes for WooCommerce

The following changes in the WooCommerce's merged AndroidManifest.xml file were detected (build variant: vanillaRelease):

--- ./build/reports/diff_manifest/WooCommerce/vanillaRelease/base_manifest.txt	2026-08-14 15:23:51.571985370 +0000
+++ ./build/reports/diff_manifest/WooCommerce/vanillaRelease/head_manifest.txt	2026-08-14 15:23:54.125196721 +0000
@@ -6,7 +6,7 @@
 
     <uses-sdk
         android:minSdkVersion="26"
-        android:targetSdkVersion="36" />
+        android:targetSdkVersion="37" />
     <!-- Mark the camera as optional, as the back camera is missing from some ChromeOS devices -->
     <uses-feature
         android:name="android.hardware.camera"

Go to https://buildkite.com/automattic/woocommerce-android/builds/41580/canvas?sid=01a000dd-249e-45ba-a21c-ae2fbcc44c9a, click on the Artifacts tab and audit the files.

@wpmobilebot

wpmobilebot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Project manifest changes for WooCommerce-Wear

The following changes in the WooCommerce-Wear's merged AndroidManifest.xml file were detected (build variant: vanillaRelease):

--- ./build/reports/diff_manifest/WooCommerce-Wear/vanillaRelease/base_manifest.txt	2026-08-14 15:24:00.229562011 +0000
+++ ./build/reports/diff_manifest/WooCommerce-Wear/vanillaRelease/head_manifest.txt	2026-08-14 15:24:02.098799505 +0000
@@ -6,7 +6,7 @@
 
     <uses-sdk
         android:minSdkVersion="26"
-        android:targetSdkVersion="36" />
+        android:targetSdkVersion="37" />
 
     <uses-feature android:name="android.hardware.type.watch" />
 

Go to https://buildkite.com/automattic/woocommerce-android/builds/41580/canvas?sid=01a000dd-249e-45ba-a21c-ae2fbcc44c9a, click on the Artifacts tab and audit the files.

@wpmobilebot

wpmobilebot commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App NameWooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Build Number778
Version25.4-rc-1
Application IDcom.woocommerce.android.prealpha
Commit1b7b733
Installation URL56huss8nfjadg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@AdamGrzybkowski
AdamGrzybkowski marked this pull request as ready for review August 13, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the project’s Android targetSdkVersion to API 37 (Android 17) and keeps existing Robolectric unit tests running by pinning them to the highest SDK currently supported by the repo’s Robolectric version.

Changes:

  • Bumped targetSdkVersion from 36 → 37 in the shared Gradle ext configuration.
  • Added robolectric.properties in affected modules’ test resources to pin Robolectric tests to sdk=36.
  • Added an internal release note entry for the target SDK update.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
settings.gradle Raises targetSdkVersion to 37 to target Android 17.
WooCommerce/src/test/resources/robolectric.properties Pins app module Robolectric tests to SDK 36 to avoid API 37 unsupported failures.
libs/store-design-system/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
libs/login/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
libs/fluxc/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
libs/fluxc-tests/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
libs/fluxc-plugin/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
libs/ai-assistant/feature/src/test/resources/robolectric.properties Pins Robolectric tests to SDK 36.
RELEASE-NOTES.txt Documents the internal target SDK update (needs PR link per file format).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread RELEASE-NOTES.txt Outdated

25.5
-----
- [*****] [Internal] Updated the app's target SDK to Android 17 (API 37)
@AdamGrzybkowski

Copy link
Copy Markdown
Contributor Author

@malinajirka and @kidinov, could one of you please review this PR, especially around BLE pairing and the local network discovery I mentioned in the PR description?

@kidinov

kidinov commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@AdamGrzybkowski

I actually don't have yet 2 devices with Android 17 but I validated this on a emulator and from what I see it doesn't work.
The phone never starts advertising: NsdManager.registerService throws SecurityException: Missing local network permission. Same emulator, same build with targetSdk 36, no exception, so it is the bump

Nothing crashes, true, but the session goes to ConnectFailed and no tablet can find the phone. The discovery side still starts fine, so from the tablet it looks alive and only finds nothing.

What is needed is to declare android.permission.ACCESS_LOCAL_NETWORK and request it at runtime before we start.

I think it'll make sense if I'll do that as I have more context and will likely neeed to add some explanation.

There is an issue WOOMOB-3313

@AdamGrzybkowski

Copy link
Copy Markdown
Contributor Author

I actually don't have yet 2 devices with Android 17 but I validated this on a emulator and from what I see it doesn't work.
The phone never starts advertising: NsdManager.registerService throws SecurityException: Missing local network permission. Same emulator, same build with targetSdk 36, no exception, so it is the bump

🤦 ahh I did test searching for devices on API 37, but not advertising...

FYI: I have updated both my devices now to Android 17, so I can verify on physical devices. Do you want to push changes to this branch or a separate one and target this one?

@kidinov

kidinov commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@AdamGrzybkowski

FYI: I have updated both my devices now to Android 17, so I can verify on physical devices. Do you want to push changes to this branch or a separate one and target this one?

I'll do that on top of this branch

@irfano irfano self-assigned this Aug 14, 2026

@irfano irfano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I ran a quick smoke test on the app side and didn't hit any issues. I also went through the behavior changes list and didn't see anything that could affect us. Approving the non-POS parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. type: technical debt Represents or solves tech debt of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants