Skip to content

chore(release): 2.0.1 - #25

Merged
pedrol2b merged 6 commits into
mainfrom
develop
Aug 20, 2026
Merged

pedrol2b merged 6 commits into
mainfrom
develop

Conversation

@pedrol2b

Copy link
Copy Markdown
Owner

Release 2.0.1 — patch release promoting 2.0.1-rc.0 to latest after the
reporter of #22 confirmed the release candidate resolves the failure.

Confirmed working with 2.0.1-rc.0.

⚠️ Merging this will auto-close #22

The fix commit (2658145) body contains Fixes #22. That keyword is inert on
develop, but lands on the default branch with this merge, so GitHub will
close the issue at merge time — before the tag, release, and npm publish
complete. Expected and accounted for; the closing comment goes up after the
publish lands.

What ships

Only the iOS selective ML Kit install build fix. No other work is riding along
— main already has everything else.

Text recognition could not build on iOS whenever any language model was
disabled through the selective install, because each case of the switch over
DomainTextRecognitionLanguage was wrapped in its own #if MLKIT_TEXT_RECOGNITION* flag while the enum declared all five
unconditionally, leaving the switch non-exhaustive. Every partial selection —
the feature's whole purpose — failed with switch must be exhaustive. The
guards now live inside each case body, so the switch stays exhaustive under
every flag combination, and an excluded language throws a descriptive error
naming the config key to enable, matching Android, instead of crashing.

Full detail in #23.

Commits

Commit
2658145 fix(ios): keep text recognition switch exhaustive under selective install
87c0417 chore(ios): update Podfile.lock
bb57f25 docs: changelog entry
79e3117 Merge PR #23
6035984 chore(release): 2.0.1-rc.0
3ddf864 chore(release): 2.0.1

Diff

6 files. TextRecognitionServiceFactory.swift is the fix;
HybridTextRecognizer.swift and HybridVisionCameraMLKit.swift propagate
throws; package.json and example/ios/Podfile.lock carry the version;
CHANGELOG.md gets the [2.0.1] section.

The CHANGELOG section was renamed from [2.0.1-rc.0] to [2.0.1] rather than
duplicated — shipped content is identical and the rc existed only to validate
against a real published artifact.

Validation

Verified on the RC by the reporter on their EAS build, and locally with real
pod install + xcodebuild per configuration, reading the emitted
SWIFT_ACTIVE_COMPILATION_CONDITIONS back from the generated xcconfig:

Config Result
latin only, pre-fix fails — switch must be exhaustive at 31:7
latin only builds
chinese only, latin disabled builds
all five builds
latin only, full app builds and links

The published 2.0.1-rc.0 tarball was also pulled back from the registry and
confirmed to contain the fixed sources.

After merge

  1. Tag v2.0.1 on the merge commit
  2. GitHub release (not prerelease) → workflow publishes to npm under latest
  3. Verify dist-tags.latest = 2.0.1
  4. Closing comment on iOS build fails with "switch must be exhaustive" when any text recognition language model is disabled #22

…tall

TextRecognitionServiceFactory wrapped each `case` of `switch language` in
its own `#if MLKIT_TEXT_RECOGNITION*` flag with no `default:`. Disabling
any single language model compiled that case out while
DomainTextRecognitionLanguage still declared all five, so the switch was
no longer exhaustive and iOS failed to build with "switch must be
exhaustive". Every partial selection broke; only all-five-enabled or
all-five-disabled (where MLKIT_TEXT_RECOGNITION_ANY drops the whole file)
compiled, which defeats the point of selective install.

Move the `#if` guards inside each `case` body via a `makeOptions(for:)`
helper returning nil for models excluded from the build. The switch now
lists all five cases unconditionally, so it stays exhaustive under every
flag combination and adding a language still fails the build until it is
handled here — which a `default:` clause would have silently swallowed.

Unavailable languages now throw a descriptive RuntimeError naming the
configuration key to enable, matching the IllegalStateException Android
already throws from its own factory, instead of crashing via fatalError.
createTextRecognizer/create become throwing, so HybridTextRecognizer.init
throws and its only call site in HybridVisionCameraMLKit uses `try`.

Fixes #22
Records the fix under [Unreleased]; the version header gets stamped at
release time. Describes the failure mode (non-exhaustive switch under any
partial language selection) and the new behavior for languages excluded
from the build.
…on-build

fix(ios): keep text recognition switch exhaustive under selective install
Release candidate carrying the iOS selective-install build fix (#22) so the
reporter can validate against the real published artifact before 2.0.1 goes
out under the latest tag. The release workflow maps the -rc. tag suffix to
the npm rc dist-tag, so latest stays on 2.0.0.

Stamps the CHANGELOG entry as 2.0.1-rc.0 and regenerates the example
Podfile.lock, which embeds the package version.
Promotes 2.0.1-rc.0 to the final release after the reporter of #22 confirmed
the release candidate resolves the iOS selective-install build failure.

The changelog section is renamed from 2.0.1-rc.0 to 2.0.1 rather than
duplicated, since the shipped content is identical and the rc existed only to
validate the fix against a real published artifact.
@pedrol2b pedrol2b self-assigned this Aug 20, 2026
@pedrol2b pedrol2b added the area: release Versioning, publishing, store submission, rollout, or release management label Aug 20, 2026
Repository owner deleted a comment from ecc-tools Bot Aug 20, 2026
Repository owner deleted a comment from ecc-tools Bot Aug 20, 2026
@pedrol2b
pedrol2b merged commit 8202153 into main Aug 20, 2026
15 checks passed
@pedrol2b
pedrol2b deleted the develop branch August 20, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: release Versioning, publishing, store submission, rollout, or release management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS build fails with "switch must be exhaustive" when any text recognition language model is disabled

1 participant