Xcode 12 beta 4 - error compiling for Simulator

An existing framework library workspace compiles without error when targeting iOS device architecture, but when targeting Simulator I receive the following error:

Code Block
Code Block
ld: in /Users/macbook/Documents/Projects/iOS/HungerStation/Code/customer-app-ios/Pods/mopub-ios-sdk/MoPubSDK/Viewability/MOAT/MPUBMoatMobileAppKit.framework/MPUBMoatMobileAppKit(MPUBMoatAnalytics.o), building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

As per this https://developer.apple.com/forums/thread/655316

Changing build setting "Build Active Architecture Only" from No to Yes doesn't solve this problem

Has anyone else seen this?
Post marked as unsolved Up vote post of kiji123 Down vote post of kiji123

38 Replies

I have multiple schemes and my application build setting is not reflecting in the pod . After adding this code in an iteration I changed pod "Build Active Architecture Only" to YES which fixed the issue

Code Block
 config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'

I am having the same issue and changing "Build Active Architecture Only" from No to Yes also does not solve the problem.
Even i am having the same problem . But when i run the same code base with xcode 11.3.1 then it works fine for me .
Right now i am unable to debug for ios 14 . Build active architecture to "Yes" doesnt solve the problem.
Facing the same issue. Please let me know here if you guys find anything useful.
For people facing this issue, @kiji123's answer actually worked for me
Just make sure you're setting this "Build active architecture" option on the pods targets as well, you can do this by adding this to your Podfile:
Code Block ruby
post_install do |installer|
  installer.pods_project.targets.each do |target|
   target.build_configurations.each do |config|
    config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'

and running pod install
The answer of @atahhan fix my issue for the module AppBoy, as well.

Enjoy :)
Running into the same thing as well. Hoping the next version of Xcode 12 beta fixes this issue. Setting "Build Active Architecture Only" to "Yes" does not fix the issue for me either.
same issue for me
I slove problem by :
Xcode -> Build Setting -> Excluded Architectures in target project and target Pod add : arm64
I've tried all of the above, and I'm getting this error:

Pods-{myprojectname}-}frameworks.sh: line 144: ARCHS[@]: unbound variable

Command PhaseScriptExecution failed with a nonzero exit code
Hi, I still have this issue with Xcode beta 5, even though I put ONLYARCHIVEARCH = YES.
Any progress anyone ?
We are also facing the same solution. The "Build Active Architecture Only" from No to Yes doesn't solve this problem. Has anyone got a solution?
Try upgrading the Project Xcode compatibility to Xcode 11 and change the VALIDARCHS to $(ARCHSSTANDARD).
It worked for me
I have the same issue for Realm framework
hi, i have the same issue... works in real device and not work in simulator, any ideas?