我的react-native应用程序在ios模拟器中编译正常,但我收到此错误:
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/F8v2.app/F8v2 normal x86_64
clang: error: no such file or directory: '/Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libReact.a'
更长的输出:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -L/Users/*****/f8app/ios/build/Build/Products/Debug-iphonesimulator -L/Users/*****/f8app/ios/build/Build/Products/Debug-iphonesimulator/CodePush -L/Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/React -F/Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator -filelist /Users/*******/f8app/ios/build/Build/Intermediates/F8v2.build/Debug-iphonesimulator/F8v2.build/Objects-normal/x86_64/F8v2.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=7.0 -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lc++ -fobjc-arc -fobjc-link-runtime /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libReact.a /Users/******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTActionSheet.a /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTGeolocation.a /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTImage.a /Users/******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTLinking.a /Users/******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTNetwork.a /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTSettings.a /Users/******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTText.a /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTVibration.a /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a -lPods-F8v2 -Xlinker -dependency_info -Xlinker /Users/******/f8app/ios/build/Build/Intermediates/F8v2.build/Debug-iphonesimulator/F8v2.build/Objects-normal/x86_64/F8v2_dependency_info.dat -o /Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/F8v2.app/F8v2
clang: error: no such file or directory: '/Users/*******/f8app/ios/build/Build/Products/Debug-iphonesimulator/libReact.a'
** BUILD FAILED **
The following build commands failed:
Ld build/Build/Products/Debug-iphonesimulator/F8v2.app/F8v2 normal x86_64
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/F8v2.app
An error was encountered processing the command (domain=LaunchServicesError, code=0):
The operation couldn’t be completed. (LaunchServicesError error 0.)
答案 0 :(得分:2)
我已通过以下方式解决:
Build Settings
>将Build Active Architecture Only
设为Yes
。Build Active Architecture Only
设置回No
。答案 1 :(得分:0)
我已经很多地处理了这个错误。每当我想到我解决了这个问题,我就会在第二天再次解决这个问题。我在android方面没有任何错误。我建议在更改xcode中的任何选项之前考虑两次。您可以尝试以下步骤。
1-)项目 - > Targets->你的项目 - >构建阶段 - >链接二进制iwth库 - >点击添加(+) - >添加添加libReact.a
2-)打开项目erp.xcodeprof - > project.pbxproj并确保不会添加任何第三方库。
3-)检查你的node_modules文件夹,如果有任何未在ios端使用的库文件夹删除它,再次构建并再次添加第三方库。
祝你好运