Skip to content

docs: guide for single-arch Android APKs (shorebirdtech/shorebird#3402) - #653

Merged
AbhishekDoshi26 merged 3 commits into
shorebirdtech:mainfrom
AzazelSensei:docs-3402-single-arch-apk
Sep 9, 2026
Merged

docs: guide for single-arch Android APKs (shorebirdtech/shorebird#3402)#653
AbhishekDoshi26 merged 3 commits into
shorebirdtech:mainfrom
AzazelSensei:docs-3402-single-arch-apk

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

I added a short guide for building a single-arch Android APK with Shorebird.

shorebird release android --artifact apk --target-platform android-arm64 has to go before --. Gradle NDK ABI filters alone still make Shorebird look for every default architecture.

Also documented shorebird releases get-apks --no-universal so you get per-ABI APKs instead of only universal.apk.

shorebirdtech/shorebird#3402
Fixes #470

Document --target-platform on shorebird release android so a
single-ABI APK can be built. Gradle NDK ABI filters alone do not
restrict the architectures Shorebird uploads.

Also document get-apks --no-universal for per-ABI APKs.
@AbhishekDoshi26

AbhishekDoshi26 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Thanks for writing this up — the flag details (--target-platform values/default, --no-universal default, --split-per-abi being unsupported, the -- placement) all check out against the current CLI source.

One claim looks stale, though. In release.mdx:

Gradle NDK ABI filters (for example ndk.abiFilters) are not enough on their own. Shorebird still looks for every architecture in --target-platform (all three by default). If Gradle drops an ABI Shorebird was asked to upload, the release fails. Keep those filters in sync with --target-platform, or drop the Gradle filters and use the flag only.

This describes the pre-fix behavior. createAndroidReleaseArtifacts in code_push_client_wrapper.dart now explicitly skips a missing arch directory instead of failing:

// Track which arch paths AGP didn't produce, so we can surface them at
// the end if zero archs uploaded. AGP omits an arch directory whenever
// the project filters it out via `ndk.abiFilters`, `splits.abi`, or
// `jniLibs.excludes`. Iterating only over present files lets a filtered
// release succeed instead of crashing on the first missing arch
// (https://github.com/shorebirdtech/shorebird/issues/3388).

It only errors if zero architectures are found for upload. Same pattern in android_patcher.dart's createPatchArtifacts, referencing the same issue. That fix (#3388) landed and was closed 2026-05-03, before this PR.

So today: a Gradle-filtered ABI that's still in --target-platform doesn't fail the release — it's silently skipped and the release ships with only the ABIs that actually built. Might be worth documenting that instead (i.e. "use --target-platform to declare intent explicitly, since a mismatched Gradle filter won't be caught with an error").

@AbhishekDoshi26 AbhishekDoshi26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small change, rest looks good. Thanks!

Missing arch dirs are skipped, not a release failure. Use
--target-platform to declare intent; a mismatched filter is silent.
@AzazelSensei

Copy link
Copy Markdown
Contributor Author

You're right — that was the old behavior, before #3388. I updated the Gradle filter note in release.mdx (and the matching FAQ line): a filtered ABI that's still in --target-platform is skipped, and the release ships with whatever actually built. --target-platform is how you declare intent; a mismatch no longer fails the release.

@AbhishekDoshi26 AbhishekDoshi26 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM — fixed a Prettier formatting issue on release.mdx.

@AbhishekDoshi26
AbhishekDoshi26 enabled auto-merge (squash) September 9, 2026 12:30
@AbhishekDoshi26
AbhishekDoshi26 merged commit 67888de into shorebirdtech:main Sep 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build: Build Apk and exclude somes Abi

2 participants