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?
Errors mentioned in here while deploying to simulator using xcode 12 are also one of the things which have affected me. Just right clicking on each of my projects and showing in finder, opening the .xcodeproj in Atom, then going through the .pbxproj and removing all of the VALIDARCHS settings. This was is what got it working for me.

Tried a few of the other suggestions (excluding arm64, Build Active Architecture Only) which seemed to get my build further but ultimately leave me at another error. Having VALID
ARCH settings lying around is probably best thing to check for first.
CVD442 Thanks for your solution:


Errors mentioned in here while deploying to simulator using xcode 12 are also one of the things which have affected me. Just right clicking on each of my projects and showing in finder, opening the .xcodeproj in Atom, then going through the .pbxproj and removing all of the VALIDARCHS settings. This was is what got it working for me.
Tried a few of the other suggestions (excluding arm64, Build Active Architecture Only) which seemed to get my build further but ultimately leave me at another error. Having VALIDARCH settings lying around is probably best thing to check for first.


Lost 2 days on this - bah! Want to give REAL Kudos to those who actually helped solve this problem:

stschwar @ github in this post: https://github.com/CocoaPods/CocoaPods/issues/10059
pointed to this SO post with a simple solution: https://stackoverflow.com/questions/63391793/xcode-12-build-target-in-wrong-order/63405201#63405201

XCode has a deserved 3 stars for many reasons, this is one of them! Counterproductivity kills.
Some respondents have solved this problem on Intel chip MAC machines
But If I want run this on Apple Silicon Mac ,How to fix ,
In Apple Silicon , I meet same problem
Code Block building for iOS Simulator, but linking in object file built for iOS, file '../SDK/***.framework/***' for architecture arm64clang: error: linker command failed with exit code 1 (use -v to see invocation)


How to fix it ?
Hope someone can give a perfect answer

Hey, I have a solution that worked for a React Native project I had.

Xcode:
  • Project -> Build Settings -> Architectures -> Exclude Architectures
    • Add "Any iOS Simulator SDK" with a value of arm64 for both debug and release.

VS Code or Mac Terminal
  • Open a terminal for your project.

    • run command npx react-native run-ios

I struggled for a long time trying to add the arm64 to the excluded Architectures and cleaning the app/ rebuilding to get things to work. I tried all the other things I could find through other forums, but it wasn't until I tried to build the app with the npx command in a different terminal that the projects properly linked. The build was successful and will start a simulator. I just exited out of that simulator, went back to Xcode, ran the app again and it worked. I don't have a reason as to why this worked for me, but something else for you all to try.







Same issue. This is frustrating. I have a new Macbook Pro with the M1 chip.
If you are developing a React Native based solution and you are using NVM for local Node versioning, the error may be due to this.

XCode cannot find the Node version, of course XCode fetches the Node in the / usr / local / bin / node directory and NVM stores the Node in another directory like Users / $ {my-user} /. Nvm / versions /node/v14.16.0/bin/node

To work it is enough to create an alias for XCode to find the Node in its default search:

ln -s $ (which node) / usr / local / bin / node
If you are developing a React Native based solution and you are using NVM for local Node versioning, the error may be due to this.

XCode cannot find the Node version, of course XCode fetches the Node in the /usr/local/bin/node directory and NVM stores the Node in another directory like Users/${my-user}/.nvm/versions/node/v14.16.0/bin/node

To work it is enough to create an alias for XCode to find the Node in its default search:

ln -s $ (which node)/usr/local/bin/node

Try to install pod again Open terminal change your project directory install pod

If you were using an SSH client you should add authentication : security unlock-keychain -p

We need to add 'arm64' in excluded architecture if you are trying to run in simulator and remove the same if you are running in a real device.

Xcode 12 beta 4 - error compiling for Simulator
 
 
Q