简体   繁体   English

ld:找不到用于 -lDoubleConversion React Native 0.59 的库

[英]ld: library not found for -lDoubleConversion React Native 0.59

I have this error我有这个错误

❌  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)

here is what i did这是我所做的

  1. I clean and rebuild still have the error我清理和重建仍然有错误
  2. rm -f ~/Library/Developer/Xcode/DerivedData/ModuleCach rm -f ~/Library/Developer/Xcode/DerivedData/ModuleCach

First of all, make sure that Libraries -> React.xcodeproj -> ThirdParty -> double-conversion exists and a static library is being produced from it, like this:首先,确保Libraries -> React.xcodeproj -> ThirdParty -> double-conversion存在并且正在从中生成一个静态库,如下所示:

在此处输入图片说明

Then, if are you're using cocoapods, make sure to add DoubleConversion to your Podfile :然后,如果您使用的是 cocoapods,请确保将DoubleConversion添加到您的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

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.最后,如果到目前为止这些都不起作用,您可以手动运行一个脚本来解决 React 的第三方依赖项。

Just go to node_modules/react-native and type:只需转到node_modules/react-native并输入:

$ ./scripts/ios-install-third-party.sh

Important : Always run it inside node_modules/react-native .重要提示:始终在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 .因为,据我所知,脚本使用相对路径来存储第三方的源代码,而 react native 将始终在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.注意:此脚本可能已经作为项目的构建阶段运行。

I followed the answers on Why linker link static libraries with errors?我遵循了为什么链接器链接静态库有错误的答案 iOS but nothing worked for me since I was combining the answers. iOS,但自从我结合答案以来,对我没有任何作用。

I got it to work by ONLY doing the "create new Swift-file"-trick.通过执行“创建新的 Swift 文件”技巧就让它工作了。 So remove everything, do a fresh install and only add a new Swift-file that will create the Bridging Header (dont delete the Swift-file).所以删除所有东西,重新安装,只添加一个新的 Swift 文件来创建桥接头(不要删除 Swift 文件)。

This is what finally worked for me.这就是最终对我有用的方法。 (Before proceeding, make sure pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' is included in your podfiles (在继续之前,请确保pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'包含在您的 podfile 中

1. Delete Podfile.lock
2. cd ios
3. pod deintegrate
4. pod install
5. cd ..
6. rm -rf node_modules && yarn
7. Add use_frameworks! to your Podfile

Run react-native-run-ios or Build with Xcode by opening the xcworkspace file in your ios directory.通过打开 ios 目录中的 xcworkspace 文件运行 react-native-run-ios 或 Build with Xcode。

This is what finally worked for me.这就是最终对我有用的方法。

pod deintegrate吊舱解体

pod install吊舱安装

Open project in X-Code在 X-Code 中打开项目

Remove Resources folder from left sidebar从左侧边栏中删除资源文件夹

Build your project from New Build System.从 New Build System 构建您的项目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 反应本机 063 ld:找不到 -lDoubleConversion 的库 - react native 063 ld: library not found for -lDoubleConversion 使用 React-native init,无法在 Xcode 中构建新的 iOS 应用程序,构建错误“ld: library not found for -lDoubleConversion - using React-native init, a new iOS app can't build in Xcode, build error 'ld: library not found for -lDoubleConversion 获取错误:“未找到用于 -lDoubleConversion 的库”,尝试产品 -> 存档时使用 React Native 0.61.4 和 xcode 12.1 - Getting error: "library not found for -lDoubleConversion" with React native 0.61.4 and xcode 12.1 while trying to product -> archive 找不到用于 -lDoubleConversion 的库 - library not found for -lDoubleConversion 使用React Native的CocoaPod:`ld:找不到-lReact`的库 - CocoaPods with React Native: `ld: library not found for -lReact` ld:找不到Xcode中-lFirebaseCore的库本地响应 - ld: library not found for -lFirebaseCore in Xcode react native ld:找不到 -lCocoaAsyncSocket 的库 - React Native - ld: library not found for -lCocoaAsyncSocket - React Native ld:找不到 -lDoubleConversion clang 的库:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用) - ld: library not found for -lDoubleConversion clang: error: linker command failed with exit code 1 (use -v to see invocation) React-Native 错误 ld:找不到 -lBVLinearGradient 的库 - React-Native error ld: library not found for -lBVLinearGradient React Native 0.63.2 iOS `ld: library not found for -lAppAuth` 构建错误 - React Native 0.63.2 iOS Build Error with `ld: library not found for -lAppAuth`
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM