0

I am using Xcode Version 14.0.1 (14A400) & Mac OS Monterey 12.6 &

pod 'Firebase/MLVision'
pod 'Firebase/MLVisionTextModel'

When I run the app on the real device it works fine. When I run on the simulator it shows the below error:

error build: In../Pods/FirebaseMLCommon/Frameworks/FirebaseMLCommon.framework/FirebaseMLCommon(aligned_new_bca0ac320467a2457b3e306bfed17856.o), building for iOS Simulator, but linking in object file built for iOS, file '/Volumes/Mydocument/Workspace/IOS/Runnig/bcbl-ios-app/Pods/FirebaseMLCommon/Frameworks/FirebaseMLCommon.framework/FirebaseMLCommon' for architecture arm64

Please help to solve the problem

Enamul Haque
  • 4,789
  • 1
  • 37
  • 50

1 Answers1

0

First, is your mac apple silicon CPU type or intel CPU type?

Not all 3rd party dependencies work on iOS simulators. You have to understand the architecture for a real iOS device is usually arm64. However, the simulator's architecture is Simulator-x86_64 on an intel mac and Simulator-arm64 on an apple silicon mac. So unless google provides you with a fat universal version of it, you cannot build it for simulators.

So, you can try to exclude the Simulator-arm64 arch in Xcode as suggested in this thread.

BTW, if it does not work, another thread points out that the MLVisionTextModel is deprecated. Consider migrating to the new pod. Cause in the new pod GoogleMLKit/TextRecognition, I have seen the below code in its podfile. So I guess it supports x86_64 simulators.

  "pod_target_xcconfig": {
   "EXCLUDED_ARCHS[sdk=iphonesimulator*]": "arm64"
   },
kakaiikaka
  • 3,530
  • 13
  • 19