React-native: After updating to Xcode 12 I get The linked library 'libPods-*****.a' is missing one or more architectures required by this target: arm64.

Created on 19 Sep 2020  ·  50Comments  ·  Source: facebook/react-native

Description

After updating to Xcode 12 I get this error:

The linked library 'libPods-*****.a' is missing one or more architectures required by this target: arm64.

Anyone knows how can solve it?

Author Feedback Environment Info iOS Xcode

Most helpful comment

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please upgrade to the latest CocoaPods (at least 1.10.0).

If doesn't work:

Note: If you are using Hermes, this will not work. Go to the next workaround.

Please go to Build Settings -> Excluded Architectures -> Debug (or the schema you are using to run on an iOS Simulator) and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

If doesn't work:

Do it for both your project and Pods. If your project is named RNTestProject (react-native init RNTestProject), you will have to do it for RNTestProject and Pods. Remember to do it in both places, otherwise, the error will keep happening.

More information on this workaround is available in this StackOverflow issue: https://stackoverflow.com/a/64139830

Please keep in mind that this is workaround and not an official answer to the problem. We will investigate this and publish a recommendation once we have analysed all the pros and cons of each alternative solutions.

All 50 comments

Running into this after I updated Xcode to v12.

ld: in /Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

On "react-native": "0.62.2"

:warning: Missing Environment Information
:information_source: Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

Please go back and fill out the issue template: what details / versions are you running?

Running into this after I updated Xcode to v12.

ld: in /Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/user/Projects/example/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

On "react-native": "0.62.2"

Same error, here. I've met it when I run detox build ios.

env)
RN 0.63.2
Xcode 12.0, Build version 12A7209

command)
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace ios/HelloDetox.xcworkspace -scheme HelloDetox -configuration Release -sdk iphonesimulator -derivedDataPath ios/build

❌ error: The linked library 'libPods-xxx.a' is missing one or more architectures required by this target: arm64. (in target 'xxx' from project 'xxx')

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening licaijia.xcworkspace. Run CLI with --verbose flag for more details.

env:
RN 0.61.5
Xcode Version 12.0 (12A7209)
macOS Big Sur Version 11.0 Beta (20A5374g)

I also have the same issue after updating to Xcode 12.0

RN 0.63.2
Xcode Version 12.0 (12A7209)
macOS Catalina 10.15.5 (19F101)

I had a similar issue... my ‘quick’ (It took me hours) fix was:

  • Create a new project with npx react-native init
  • Install dependencies and make sure the new project builds and runs on Xcode.
  • Copy all the source code from my pre-xcode-update project into the brand new, post-xcode-update compatible project.
  • Install all the previous dependencies required one by one with npm and pod install (If needed).

Luckily, the project’s structure allowed me to do this, but it was really frustrating and confusing. Hope this get resolved for future developers.

✌️

I had a similar issue... my ‘quick’ (It took me hours) fix was:

  • Create a new project with npx react-native init
  • Install dependencies and make sure the new project builds and runs on Xcode.
  • Copy all the source code from my pre-xcode-update project into the brand new, post-xcode-update compatible project.
  • Install all the previous dependencies required one by one with npm and pod install (If needed).

Luckily, the project’s structure allowed me to do this, but it was really frustrating and confusing. Hope this get resolved for future developers.

✌️

thx, but I ran detox under fresh react-native init project which used xcode 12.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please upgrade to the latest CocoaPods (at least 1.10.0).

If doesn't work:

Note: If you are using Hermes, this will not work. Go to the next workaround.

Please go to Build Settings -> Excluded Architectures -> Debug (or the schema you are using to run on an iOS Simulator) and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

If doesn't work:

Do it for both your project and Pods. If your project is named RNTestProject (react-native init RNTestProject), you will have to do it for RNTestProject and Pods. Remember to do it in both places, otherwise, the error will keep happening.

More information on this workaround is available in this StackOverflow issue: https://stackoverflow.com/a/64139830

Please keep in mind that this is workaround and not an official answer to the problem. We will investigate this and publish a recommendation once we have analysed all the pros and cons of each alternative solutions.

thx @grabbou . It worked for me . Gracias!!

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

thx @grabbou . It works now!!

Removing VALID_ARCH from Build settings under User-Defined group work for me.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

It worked for me, but this solution is a workaround, am I right? We still need to be able to make build for arm64 architectures.

Watching this issue. Can't compile react-native projects after upgraded to xcode12

Whats the conclusion on excluding arm64 being a proper solution or a workaround? I'm not a native iOS developer and not sure what the implications are when doing this.
How did you fix this error or worked around it? (i get this from a detox-build too)

@grabbou That really fixes the build but it's wrong - you can't submit the app to the app store, arm64 cannot be in excluded architecture.

If you keep this exclusion you'll get this error:

ERROR ITMS-90086: "Missing 64-bit support. iOS apps submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK or later. We recommend using the default "Standard Architectures" build setting for "Architectures" in Xcode, to build a single binary with both 32-bit and 64-bit support."

So, I managed to set it manually in dev mode (even release), but when I want to upload to the store I removed that.

For people who want more info on this build settings change and what it does, go through this link
https://apontious.com/2020/08/23/arm-wrestling-your-ios-simulator-builds/

It is the cross compilation issue. I solve the issue by appending x86_64 to VALID_ARCHS or just removing VALID_ARCHS from User-Defined data with xcode 12.0.1 and react-native 0.63.3.

You might also need to modify Podfile by changing VALID_ARCHES for pod projects to fix the issue.

Just another data point: Removing VALID_ARCHS from the app project worked for us 👍 Didn't need to touch any pods stuff other than running pod install again.

Hi all,

Possibly this has nothing to do with the problem mentioned in this thread, so please apologize if you find it inappropriate to post this message here.

We have another problem that just arose after updating Xcode. The build succeeds (after generating main.jsbundle manually), but when uploading the archive to App Store Connect, we get the following error by mail:

ITMS-90332: Invalid Symbolic Link - The symbolic link 'react/node_modules/.bin/loose-envify' resolves to an invalid location. Make sure that the symbolic link does not resolve to itself, and that the location exists and is contained within the app bundle.

Meanwhile, I have succeeded once to upload a build successfully, but I have no clue why this worked nor why it fails. There is indeed a symbolic link named loose-envify in node_modules/.bin, but this should not be in the final archive anyway (it points to a script that is not used at runtime), so this symbolic link should not be in the archive in the first place, imo.

I got a typescript errors that cause amain.jsbundle error. Hmm.. Did somebody faced such issue after upgrading to 0.63.3 ?

Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app
warning: the transform cache was reset.
                 Welcome to React Native!
                Learn once, write anywhere


error SyntaxError: /Users/spawn/code/Work/src/screens/App/screens/Assessments/components/DashboardTile/DashboardTileImage/styledComponents.tsx: Unexpected token, expected ";" (71:42)

[0m [90m 69 | [39m}[0m
[0m [90m 70 | [39m[0m
[0m[31m[1m>[22m[39m[90m 71 | [39m[36mconst[39m getProgress [33m=[39m ({progress[33m,[39m [33m...[39mprops})[33m:[39m number [33m=>[39m {[0m
[0m [90m    | [39m                                          [31m[1m^[22m[39m[0m
[0m [90m 72 | [39m  [36mreturn[39m getStrokeDasharray(props) [33m*[39m ([35m1[39m [33m-[39m progress [33m/[39m [35m100[39m)[0m
[0m [90m 73 | [39m}[0m
[0m [90m 74 | [39m[0m. Run CLI with --verbose flag for more details.
SyntaxError: /Users/spawn/code/Work/src/screens/App/screens/Assessments/components/DashboardTile/DashboardTileImage/styledComponents.tsx: Unexpected token, expected ";" (71:42)

[0m [90m 69 | [39m}[0m
[0m [90m 70 | [39m[0m
[0m[31m[1m>[22m[39m[90m 71 | [39m[36mconst[39m getProgress [33m=[39m ({progress[33m,[39m [33m...[39mprops})[33m:[39m number [33m=>[39m {[0m
[0m [90m    | [39m                                          [31m[1m^[22m[39m[0m
[0m [90m 72 | [39m  [36mreturn[39m getStrokeDasharray(props) [33m*[39m ([35m1[39m [33m-[39m progress [33m/[39m [35m100[39m)[0m
[0m [90m 73 | [39m}[0m
[0m [90m 74 | [39m[0m
    at Object._raise (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:799:17)
    at Object.raiseWithData (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:792:17)
    at Object.raise (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:786:17)
    at Object.unexpected (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:9068:16)
    at Object.semicolon (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:9050:40)
    at Object.parseVarStatement (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:12069:10)
    at Object.parseStatementContent (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:11660:21)
    at Object.parseStatementContent (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:6751:18)
    at Object.parseStatement (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:11593:17)
    at Object.parseBlockOrModuleBlockBody (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:12175:25)
+ [[ false != true ]]
+ [[ ! -f /Users/spawn/Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app/main.jsbundle ]]
+ echo 'error: File /Users/spawn/Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app/main.jsbundle does not exist. This must be a bug with'

I upgraded to RN 0.63.3 from 0.61.5 The problem with typescript during ./gradlew assembleRelease and running from Xcode. What can be the reason ?

Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app
warning: the transform cache was reset.
                 Welcome to React Native!
                Learn once, write anywhere


error SyntaxError: /Users/spawn/code/Work/src/screens/App/screens/Assessments/components/DashboardTile/DashboardTileImage/styledComponents.tsx: Unexpected token, expected ";" (71:42)

[0m [90m 69 | [39m}[0m
[0m [90m 70 | [39m[0m
[0m[31m[1m>[22m[39m[90m 71 | [39m[36mconst[39m getProgress [33m=[39m ({progress[33m,[39m [33m...[39mprops})[33m:[39m number [33m=>[39m {[0m
[0m [90m    | [39m                                          [31m[1m^[22m[39m[0m
[0m [90m 72 | [39m  [36mreturn[39m getStrokeDasharray(props) [33m*[39m ([35m1[39m [33m-[39m progress [33m/[39m [35m100[39m)[0m
[0m [90m 73 | [39m}[0m
[0m [90m 74 | [39m[0m. Run CLI with --verbose flag for more details.
SyntaxError: /Users/spawn/code/Work/src/screens/App/screens/Assessments/components/DashboardTile/DashboardTileImage/styledComponents.tsx: Unexpected token, expected ";" (71:42)

[0m [90m 69 | [39m}[0m
[0m [90m 70 | [39m[0m
[0m[31m[1m>[22m[39m[90m 71 | [39m[36mconst[39m getProgress [33m=[39m ({progress[33m,[39m [33m...[39mprops})[33m:[39m number [33m=>[39m {[0m
[0m [90m    | [39m                                          [31m[1m^[22m[39m[0m
[0m [90m 72 | [39m  [36mreturn[39m getStrokeDasharray(props) [33m*[39m ([35m1[39m [33m-[39m progress [33m/[39m [35m100[39m)[0m
[0m [90m 73 | [39m}[0m
[0m [90m 74 | [39m[0m
    at Object._raise (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:799:17)
    at Object.raiseWithData (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:792:17)
    at Object.raise (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:786:17)
    at Object.unexpected (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:9068:16)
    at Object.semicolon (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:9050:40)
    at Object.parseVarStatement (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:12069:10)
    at Object.parseStatementContent (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:11660:21)
    at Object.parseStatementContent (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:6751:18)
    at Object.parseStatement (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:11593:17)
    at Object.parseBlockOrModuleBlockBody (/Users/spawn/code/Work/node_modules/@react-native-community/cli/node_modules/@babel/parser/lib/index.js:12175:25)
+ [[ false != true ]]
+ [[ ! -f /Users/spawn/Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app/main.jsbundle ]]
+ echo 'error: File /Users/spawn/Library/Developer/Xcode/DerivedData/ChemoSafe-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ChemoSafe.app/main.jsbundle does not exist. This must be a bug with'

// styleComponents.tsx(71:42)
const getProgress = ({progress, ...props}): number => {
  return getStrokeDasharray(props) * (1 - progress / 100)
}

UPDATED: I was able to fix it by downgrading @babel/runtime from 7.12.1 to 7.8.4 + clean/rebuild

@SpawnAtis

Please provide more details, like:

  • what command did you run?
  • more version information
  • does the app run in debug mode?

To me, it seems like there is broken typing on the function. Doesn't progress need a type of number?

I upgrade macOS mojave (10.14) to catalina (10.15.7) and download xcode 12.1. Try to build my react-native project in xcode and get this error.

  • App run in debug mode

Hope to problem will be solved in a short time

Upgrading to CocoaPods 1.10 will fix it for all of you. I have updated my previous comment as well to indicate that it is fixed: https://github.com/facebook/react-native/issues/29984#issuecomment-696328815

If you are curious, here is an original issue that talks a bit more about it https://github.com/CocoaPods/CocoaPods/issues/10026

Upgrading to CocoaPods 1.10 will fix it for all of you. I have updated my previous comment as well to indicate that it is fixed: #29984 (comment)

If you are curious, here is an original issue that talks a bit more about it CocoaPods/CocoaPods#10026

my cocopads version is the latest and i still have that problem

Same for me, unfortunately. Updating cocoapods did not seem to address the issue one way or the other. @grabbou your original solution worked for me though (even if I can't keep it for production), so it might be a good idea to make a 3rd edit

@grabbou Upgrading to CocoaPods 1.10 doesn't resolve the error for me.
Is it connected with the following issue Click ?
The only workaround for me now to add arm64 to 'Excluded Architectures' only when running on simulators.


Details

❯ pod --version
1.10.0

Podfile.lock
....
COCOAPODS: 1.10.0

watchman watch-del-all &&
rm -rf $TMPDIR/react-native-packager-cache-* &&
rm -rf $TMPDIR/metro-bundler-cache-* && 
rm -rf node_modules/ && 
yarn cache clean &&
yarn install && 
cd ios && pod install && cd - &&
yarn start -- --reset-cache

Log:
/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App normal arm64 (in target 'App' from project 'App') cd /Users/spawn/code/Work/Company/aac-app/App/ios /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios12.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphonesimulator -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/CocoaAsyncSocket -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/DoubleConversion -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXConstants -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXFileSystem -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXImageLoader -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXPermissions -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXPrint -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXSecureStore -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/EXSharing -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/FBReactNativeSpec -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/Folly -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RCTTypeSafety -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNCAsyncStorage -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNCMaskedView -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNDateTimePicker -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNDeviceInfo -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNGestureHandler -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNRate -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNReanimated -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNSVG -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNShare -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/RNVectorIcons -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-Core -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-CoreModules -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTAnimation -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTBlob -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTImage -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTLinking -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTNetwork -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTSettings -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTText -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-RCTVibration -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-cxxreact -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-jsi -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-jsiexecutor -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/React-jsinspector -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/ReactCommon -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/UMAppLoader -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/UMCore -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/UMPermissionsInterface -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/UMReactNativeAdapter -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/Yoga -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/YogaKit -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/glog -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/jail-monkey -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-config -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-image-picker -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-netinfo -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-pdf -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-progress-view -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/react-native-safe-area-context -L/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator/rn-fetch-blob -L/Users/spawn/code/Work/Company/aac-app/App/ios/Pods/CocoaLibEvent/lib -L/Users/spawn/code/Work/Company/aac-app/App/ios/Pods/OpenSSL-Universal/ios/lib -F/Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Products/Release-iphonesimulator -F/Users/spawn/code/Work/Company/aac-app/App/ios -filelist /Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/App.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/ChemoSafe_lto.o -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lCocoaAsyncSocket -lDoubleConversion -lEXConstants -lEXFileSystem -lEXImageLoader -lEXPermissions -lEXPrint -lEXSecureStore -lEXSharing -lFBReactNativeSpec -lFolly -lRCTTypeSafety -lRNCAsyncStorage -lRNCMaskedView -lRNDateTimePicker -lRNDeviceInfo -lRNGestureHandler -lRNRate -lRNReanimated -lRNSVG -lRNShare -lRNVectorIcons -lReact-Core -lReact-CoreModules -lReact-RCTAnimation -lReact-RCTBlob -lReact-RCTImage -lReact-RCTLinking -lReact-RCTNetwork -lReact-RCTSettings -lReact-RCTText -lReact-RCTVibration -lReact-cxxreact -lReact-jsi -lReact-jsiexecutor -lReact-jsinspector -lReactCommon -lUMAppLoader -lUMCore -lUMPermissionsInterface -lUMReactNativeAdapter -lYoga -lYogaKit -lcrypto -levent -levent_core -levent_extra -levent_pthreads -lglog -ljail-monkey -lreact-native-config -lreact-native-image-picker -lreact-native-netinfo -lreact-native-pdf -lreact-native-progress-view -lreact-native-safe-area-context -lrn-fetch-blob -lssl -lstdc++ -framework AudioToolbox -framework CFNetwork -framework JavaScriptCore -framework MobileCoreServices -framework Security -framework UIKit -ObjC -lc++ -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/App.app-Simulated.xcent -lPods-ChemoSafeApp-App -Xlinker -dependency_info -Xlinker /Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/ChemoSafe_dependency_info.dat -o /Users/spawn/Library/Developer/Xcode/DerivedData/App-fnvlvransqahaxdehhyqdidragnt/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/arm64/Binary/App
ld: in /Users/spawn/code/Work/IBM/aac-chemosafe/ChemoSafe/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/spawn/code/Work/IBM/aac-chemosafe/ChemoSafe/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64


edited by @kelset to fold the details and preserve readibility

Seems like OpenSSL-Universal missing artifacts seems to be the common denominator. Here is the relevant ticket on its repo: https://github.com/krzyzanowskim/OpenSSL/issues/89

Seems like OpenSSL-Universal missing artifacts seems to be the common denominator. Here is the relevant ticket on its repo: krzyzanowskim/OpenSSL#89

I ended up removing Flipper for now as it was only causing me troubles, mainly due to OpenSSL.
I can confirm than once I did and also removed the "excluded ARM64 hack", everything is working fine with CocoaPods 1.10.

Updated my original comment and reopening.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please upgrade to the latest CocoaPods (at least 1.10.0).

If doesn't work:

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

This worked for me. Excluded Architectures added to the "Project" not to the Targets

I can confirm that excluded ARM64 in "Project" not to the Targets, everything is working fine and update CocoaPods 1.10. But ¿What repercussions does this bring?

So as others have mentioned updating to cocoapods 1.10.0 in combination with the arm64 exclusion on debug builds works. But don't forget to run pod update !! If you don't run pod update your podfile won't be updated !!

1. update cocoa pods -> check version -> pod --version
2. Build Settings -> Excluded Architectures -> Debug and add arm64 there.
3. pod update

Hi,

Having same issue after upgrading from xCode 11 to xCode 12.

I have tried to :

  • update cocoapods to 1.10.0
  • remove VALID_ARCH in projet
  • run pod update
  • relaunch xcode 12
  • add arm64 or not in the Excluded Architecture

But still I got this damn issue with libcrypto.

Any other solution that migh work ? I am a bit lost in this xCode config issue.

thx @grabbou . It worked for me . Gracias!!

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please upgrade to the latest CocoaPods (at least 1.10.0).

If doesn't work:

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

For everyone running into

building for iOS Simulator, but linking in object file built for iOS for architecture arm64

Please upgrade to the latest CocoaPods (at least 1.10.0).

If doesn't work:

Please go to Build Settings -> Excluded Architectures -> Debug and add arm64 there. See https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios for more.

@grabbou Thanks! It works!

Has anyone checked if this issue is still present with the react native 0.64 rc?

Has anyone checked if this issue is still present with the react native 0.64 rc?

After installing 0.64.0-rc.1 problem is gone

Has anyone checked if this issue is still present with the react native 0.64 rc?

It fails for me only when building a release version for the iOS simulator:
Clean RN project used: npx react-native init RN064 --version 0.64.0-rc.1
on my laptop running macOS Big Sur 11.0.1 (20B29)
with the Xcode Version 12.2 (12B45b)

Debug-iphoneos: :white_check_mark:

Release-iphoneos: :white_check_mark:

Debug-iphonesimulator: :white_check_mark:

Release-iphonesimulator: :heavy_exclamation_mark:

ld: in /xxx/RN064/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(cryptlib.o), building for iOS Simulator, but linking in object file built for iOS, file '/xxx/RN064/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As to my understanding, the OpenSSL-Universal pod version needs to be updated. The latest version should include all artefacts needed for the new targets.

Flipper (0.54.0):
    - Flipper-Folly (~> 2.2)
Flipper-Folly (2.3.0):
    - OpenSSL-Universal (= 1.0.2.20) // current latest: 1.1.171

@kelset the issue has more to do with Xcode 12 (added new simulator target) than RN itself and will most likely affect other versions too.

Updated my original comment with a workaround by adding an additional alternative solution, that fixes issues when building Hermes in Release mode.

https://github.com/facebook/react-native/issues/29984#issuecomment-696328815

This thread is a little messy, so I’m unsure if this addresses the issue of all of the people that have chimed in. For those that have been dealing with build failures like:

[some file path], building for iOS Simulator, but linking in object file built for iOS, file '[some file path]' for architecture arm64

This issue has started coming up with Xcode 12 and support for the new ARM based Macs, as arm64 now no longer can be assumed to _only_ be for iOS devices. This means Xcode 12 will now also build for arm64 simulator SDKs and it has become ambiguous if an arch slice in a prebuilt binary is meant for a simulator or device.


In any case, for now this means that you can configure your Xcode project to exclude arm64 when building for any iOS simulator SDK:

Screenshot 2020-12-02 at 18 12 11

(To those of you that use the new ARM based Macs, it would be good to know if this works for you too.)

Here's a PR with a fix, based on the research in this thread: https://github.com/facebook/react-native/pull/30543

(To those of you that use the new ARM based Macs, it would be good to know if this works for you too.)

For whoever might be interested about this, I left some feedback here: https://github.com/facebook/react-native/pull/30543#issuecomment-740161332

(To those of you that use the new ARM based Macs, it would be good to know if this works for you too.)

Forgive me if this is a stupid question, but isn't the simulator on the ARM based macs also based on the new architecture? I.e. wouldn't it make sense to exclude x86 instead of excluding arm64?

I think it runs arm64 apps in the simulator, but can't verify as I don't have one. If we excluded x86 though, wouldn't that break building on the x86-based simulator?

I think it runs arm64 apps in the simulator, but can't verify as I don't have one. If we excluded x86 though, wouldn't that break building on the x86-based simulator?

Maybe, but I'm using an M1 mac and am trying to get it working with RN, so I personally don't care for x86 anymore 😄

@AdamGerthel @andreialecu We’re trying to come up with a stopgap solution that works for owners of either CPU. Could one of you provide the result of running /usr/sbin/sysctl -n machdep.cpu.brand_string ?

UPDATE: As well as /usr/sbin/sysctl -n hw.optional.arm64 ?

Not on M1 but does removing VALID_ARCHS entirely not work for you guys? No excluding required...

@mjmasn New projects where it can be reproduced don’t have that setting set.

Was this page helpful?
0 / 5 - 0 ratings