Skip to content

Pr/862#865

Closed
utkuvrs wants to merge 3 commits into
flutter-ml:developfrom
utkuvrs:pr/862
Closed

Pr/862#865
utkuvrs wants to merge 3 commits into
flutter-ml:developfrom
utkuvrs:pr/862

Conversation

@utkuvrs
Copy link
Copy Markdown

@utkuvrs utkuvrs commented May 20, 2026

No description provided.

lucasdonordeste and others added 3 commits May 8, 2026 23:41
Apple removed Rosetta 2 from the default iOS 26 simulator runtime, which
breaks `flutter run` for any project depending on Google ML Kit on
Apple Silicon Macs. The published GoogleMLKit/* CocoaPods only ship
arm64-iphoneos and x86_64-iphonesimulator slices and pin
EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64, so the simulator build
no longer finds a matching destination and dies with
"Unable to find a destination matching the provided destination specifier".

Until Google publishes proper arm64-iphonesimulator slices
(https://issuetracker.google.com/issues/178965151), this change ships an
opt-in Podfile helper under google_mlkit_commons that:

1. Re-labels the existing arm64 device slice of every ML Kit framework
   binary as iOS Simulator. Only the 4-byte LC_BUILD_VERSION.platform
   field is changed (2 -> 7), the same approach the well-known
   arm64-to-sim tool uses on closed-source SDKs. Idempotent.
2. Strips EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 from the
   xcconfigs CocoaPods generates from the pod's user_target_xcconfig,
   so the user's app target is allowed to build for arm64-iphonesimulator.

The example/ios Podfile is wired to call the helper from post_install,
which lets the example app build, install and run on an Apple Silicon
iOS 26.3 simulator. End-to-end validated: Text Recognition on the
Text-From-Widget view returned the exact widget text. Device builds and
release builds are not affected.

Closes flutter-ml#825
The Ruby and Python entry points already have a brief header pointing at
the README. Per-function docstrings were restating what the function name
already said, and the Podfile inline comments duplicated the helper's
self-documenting name.
Integrate Apple Vision to derive confidence scores and text rotation angles alongside MLKit results. Runs VNRecognizeTextRequest on the same image (converted to CGImage for parity) and maps observations to pixel coordinates; matches observations to MLKit element/line frames by IoU (threshold 0.3) to pick a best confidence. Populates per-element confidences (and per-line averages or fallback matches), computes line/element angles from corner points, and adds CGImage extraction helpers for file/bytes/bitmap imageData (including CVPixelBuffer/CIImage conversion and safe memory handling). Falls back to nil confidences if Vision processing fails.
@utkuvrs utkuvrs closed this May 20, 2026
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.

2 participants