Description
What happened?
When i tried running the ios part of my project after installing @react-native-ml-kit/text-recognition v1.5.2, it fails with the following error "found architecture 'arm64', required architecture 'x86_64'". The project works well on Android but fails to run and build on IOS. I tried modifying my Podfile post install like so:
`post_install do |installer|
# Existing React Native post-install steps
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
# ---- Begin Custom M1 Mac Configuration ----
# This ensures that for iOS simulator builds on M1 Macs,
# the arm64 architecture is not excluded.
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = ""
end
end
# ---- End Custom M1 Mac Configuration ----
end`
It still didn't work
LOGS FROM XCODE BUILD
Undefined symbols for architecture x86_64:
"_GULLogBasic", referenced from:
_MLKLog in MLKitCommon[x86_64]7
"OBJC_CLASS$_GDTCORTransport", referenced from:
in MLKitCommon[x86_64]6
"OBJC_CLASS$_GTMLogMininumLevelFilter", referenced from:
in MLKitCommon[x86_64]200
"OBJC_CLASS$_GTMLogger", referenced from:
in MLKitCommon[x86_64]26
OBJC_CLASS$_MLKITx_GIPLoggingReroutingGTMLogger in MLKitCommon[x86_64]200
"OBJC_CLASS$_GTMSessionCookieStorage", referenced from:
in MLKitCommon[x86_64]26
"OBJC_CLASS$_GTMSessionFetcher", referenced from:
in MLKitCommon[x86_64]26
"OBJC_CLASS$_GTMSessionFetcherService", referenced from:
in MLKitCommon[x86_64]18
"OBJC_CLASS$_GULCCComponent", referenced from:
in MLKitCommon[x86_64]11
"OBJC_CLASS$_GULCCComponentContainer", referenced from:
in MLKitCommon[x86_64]3
"OBJC_CLASS$_GULCCComponentType", referenced from:
in MLKitCommon[x86_64]3
"OBJC_CLASS$_GULUserDefaults", referenced from:
in MLKitCommon[x86_64]2
"OBJC_CLASS$_RCTAppDelegate", referenced from:
full type metadata for capi.AppDelegate in AppDelegate.o
"OBJC_CLASS$_RCTAppDependencyProvider", referenced from:
in AppDelegate.o
"OBJC_CLASS$_RCTBundleURLProvider", referenced from:
in AppDelegate.o
"OBJC_CLASS$_RNBootSplash", referenced from:
in AppDelegate.o
"OBJC_METACLASS$_GTMLogger", referenced from:
OBJC_METACLASS$_MLKITx_GIPLoggingReroutingGTMLogger in MLKitCommon[x86_64]200
"OBJC_METACLASS$_RCTAppDelegate", referenced from:
OBJC_METACLASS$__TtC4capi11AppDelegate in AppDelegate.o
"_kGTMSessionFetcherStatusDomain", referenced from:
___69-[MLKModelDownloader beginModelDownloadWithURL:modelInfo:conditions:]_block_invoke.285 in MLKitCommon[x86_64]18
___150-[MLKITx_PHTHeterodyneSyncer batchSyncWithAccounts:syncedScopes:fetchReason:throttlingCache:heterodyneSyncInfo:accountToAuthToken:lastError:callback:]_block_invoke in MLKitCommon[x86_64]48
___91-[MLKITx_PHTInternalHeterodyneSyncer syncHoldingLockWithSyncedScopes:fetchReason:callback:]_block_invoke in MLKitCommon[x86_64]51
___63-[MLKITx_GMVCloudVisionClient initWithCloudUri:apiKey:options:]_block_invoke in MLKitVision[x86_64]7
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
LOGS FROM RUNNING "npm run ios"
error .o)': found architecture 'arm64', required architecture 'x86_64'
error callback:]_block_invoke in MLKitCommon[x86_64]48
error linker command failed with exit code 1 (use -v to see invocation)
error Failed to build ios project. "xcodebuild" exited with error code '65'. To debug build logs further, consider building your app with Xcode.app, by opening 'capi.xcworkspace'.
Version
"@react-native-ml-kit/text-recognition": "^1.5.2"
Which ML Kit packages do you use?
- @react-native-ml-kit/barcode-scanning
- @react-native-ml-kit/face-detection
- @react-native-ml-kit/identify-languages
- @react-native-ml-kit/image-labeling
- @react-native-ml-kit/text-recognition
- @react-native-ml-kit/translate-text
What platforms are you seeing this issue on?
- Android
- iOS
System Information
System:
OS: macOS 15.2
CPU: (8) arm64 Apple M1 Pro
Memory: 91.58 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.11.0
path: ~/.nvm/versions/node/v22.11.0/bin/node
Yarn: Not Found
npm:
version: 11.1.0
path: ~/.nvm/versions/node/v22.11.0/bin/npm
Watchman:
version: 2024.01.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.2
- iOS 18.2
- macOS 15.2
- tvOS 18.2
- visionOS 2.2
- watchOS 11.2
Android SDK:
API Levels:
- "28"
- "31"
- "33"
- "34"
- "35"
Build Tools:
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 34.0.0
- 35.0.0
- 35.0.1
System Images:
- android-29 | Google APIs ARM 64 v8a
- android-29 | Google Play ARM 64 v8a
- android-30 | Google APIs ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.2 AI-242.23726.103.2422.12816248
Xcode:
version: 16.2/16C5032a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 15.0.1
wanted: 15.0.1
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.77.1
wanted: 0.77.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Steps to Reproduce
- Use an M1 mac
- Create a new app ("react": "18.3.1") and ("react-native": "0.77.1",)
- Install version 1.5.2 of @react-native-ml-kit/text-recognition
- Try starting the ios project via "npm run ios" in the terminal
- Try building the ios project via xcode
- App fails with the error ---> found architecture 'arm64', required architecture 'x86_64'