ld:找不到-lDoubleConversion React Native 0.59的库 [英] ld: library not found for -lDoubleConversion React Native 0.59
问题描述
我遇到此错误
❌ ld: library not found for -lDoubleConversion
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
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 App.xcworkspace
** BUILD FAILED **
The following build commands failed:
Ld /Users/mohamedelmi/workspace/elmi/food-frontend/ios/build/App/Build/Intermediates.noindex/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64
(1 failure)
这是我所做的
- 我清理并重建仍有错误
- rm -f〜/Library/Developer/Xcode/DerivedData/ModuleCach
推荐答案
首先,确保Libraries -> React.xcodeproj -> ThirdParty -> double-conversion
存在并且正在从中生成静态库,如下所示:
First of all, make sure that Libraries -> React.xcodeproj -> ThirdParty -> double-conversion
exists and a static library is being produced from it, like this:
然后,如果您使用的是椰壳动物,请确保将DoubleConversion
添加到您的Podfile
:
Then, if are you're using cocoapods, make sure to add DoubleConversion
to your Podfile
:
target 'MyApp' do
pod 'React', :path => "../node_modules/react-native", :subspecs => [
'Core',
'CxxBridge',
'DevSupport',
# the following ones are the ones taken from "Libraries" in Xcode:
'RCTAnimation',
'RCTActionSheet',
'RCTBlob',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
pod 'yoga', :path => "../node_modules/react-native/ReactCommon/yoga"
# Here it goes
pod 'DoubleConversion', :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec"
end
最后,如果到目前为止所有这些都不起作用,则可以使用一个脚本手动运行 为了解决React的第三方依赖关系.
And finally, if none of this worked so far, there's a script you can manually run in order to resolve React's third-party dependencies.
只需转到node_modules/react-native
并输入:
$ ./scripts/ios-install-third-party.sh
重要:始终在node_modules/react-native
内部运行它.因为据我所知,该脚本使用相对路径来存储第三方的源代码,并且react native将始终在node_modules/react-native/third-party
处查找它.因此,只需确保在正确的位置运行它即可.
Important: Always run it inside node_modules/react-native
. Because, as far as I know, the script uses relative paths in order to store third-party's source code and react native will always look for it at node_modules/react-native/third-party
. So just make sure to run it in the right place.
注意:该脚本可能已经在您的项目中作为构建阶段运行.
Note: This script is, probably, already running as a build phase on your project.
这篇关于ld:找不到-lDoubleConversion React Native 0.59的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!