luke
luke

Reputation: 113

Is it possible to exclude specific pods when building to iOS simulator?

Currently I'm facing a problem, that one of my projects can't be built to arm64 simulator when using one of the Google MLKit's pods.

I was searching all around the internet, but couldn't find anything similar to this.

Is it somehow possible to exclude specific pod (in this case Google MLKit) from build to simulator? Or include it only to device builds?

ld: building for iOS Simulator, but linking in object file built for iOS, file 'app/ios/Pods/MLKitBarcodeScanning/Frameworks/MLKitBarcodeScanning.framework/MLKitBarcodeScanning' for architecture arm64

Thanks.

Upvotes: 1

Views: 1626

Answers (1)

LinhNV
LinhNV

Reputation: 29

I am using Xcode 13 and a MacBook with M1 chip and faced same error with MLKits

I had found that:

  1. iOS simulator not allow run arm64 architecture (arm64 in simulators not like arm64 in real devices). So in "excluded architectures": "Any iOS simulator SDK: i386 arm64" (use default) (include debug, profile, release)

  2. MLKits does not allow run on 32 bit. We can config it in Architectures but it conflict with iOS simulators above. So I config it in excluded architectures: "Any iOS SDK: armv7" (include debug, profile, release)

  3. Add "Required device capabilities" in Info and only item "arm64"

Now my project can auto run on iOS simulators (x86_64) and real devices (arm64).

Here is my config

Upvotes: 2

Related Questions