Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教:pod install 后Xcode 报错 Showing Recent Issues clang: error: linker command failed with exit code 1 (use -v to see invocation) #58

Closed
feifeimonghuan3 opened this issue May 21, 2018 · 9 comments

Comments

@feifeimonghuan3
Copy link

feifeimonghuan3 commented May 21, 2018

react-native 版本: 0.55.2

以下为 Podfile 配置文件

platform :ios, '8.0'

target 'hekjTanyu' do

pod 'React', :path => './../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
'RCTAnimation', # Needed for FlatList and animations running on native UI thread

]

pod 'yoga', :path => './../node_modules/react-native/ReactCommon/yoga'

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'

pod 'react-native-baidumap-sdk', path: '../node_modules/react-native-baidumap-sdk/lib/ios'
[end](url)

**Xcode报错 **

ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/Folly'
ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/React'
ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/glog'
ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/react-native-baidumap-sdk'
ld: warning: directory not found for option '-L/Users/lx/Library/Developer/Xcode/DerivedData/hekjTanyu-cyxjsqzuukbpxdbhuvwotxilkowg/Build/Products/Debug-iphonesimulator/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

谢谢🙏

@qiuxiang
Copy link
Owner

@feifeimonghuan3
Copy link
Author

feifeimonghuan3 commented May 21, 2018

从新生成的项目导入SDK是没有问题的,可能是和其他的东西产生冲突了 ,我也是按照了官方文档的内容对配置文件进行了修改

@qiuxiang
Copy link
Owner

你上面给出的配置就不适用 0.55

@feifeimonghuan3
Copy link
Author

feifeimonghuan3 commented May 21, 2018

facebook/react-native#16181
我觉得我的配置应该是正确的。。。
之后又报了 'folly/folly-config.h' file not found 的错
facebook/react-native#18683

@feifeimonghuan3
Copy link
Author

feifeimonghuan3 commented May 21, 2018

RN版本: 0.55.2
这个问题是RN 0.55.2的BUG 其他的版本暂时不清楚
官方文档 0.55 的 配置Podfile 是错的 在 facebook/react-native#16181 这里提到了 文档暂时还没有进行修改
在pod install
[!] The name of the given podspec glog doesn't match the expected one GLog
报这个错的时候 请将文档上的
pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
改成:
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod install成功之后
用Xcode 打开ios目录下的 项目名.xcworkspace
又可能会报错 'folly/folly-config.h' file not found 的错误 和 native 模块缺失的错误

根据 facebook/react-native#18683 的解决方法
在Xcode打开 项目名.xcworkspace 文件

点击左上角的搜索
搜索 subspec
打开React.podspec -> s.subspec"Core" do
找到 s.subspec "Core" do |s| 下的 ss.exclude_files添加"React/Fabric/*"
修改完成之后从新 pod install 一下就能跑起来了

@YYCoder1963
Copy link

@feifeimonghuan3 @qiuxiang 我的项目添加"React/Fabric/*"完后,CodePush里面报错could not build moudle 'react',并且RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode里面会报错Expected')',很奇怪,你们有遇到吗

@feifeimonghuan3
Copy link
Author

@lyayun 你有从新 pod install 一下么

@YYCoder1963
Copy link

@feifeimonghuan3 有的

@feifeimonghuan3
Copy link
Author

@lyayun 没碰到过这个问题。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants