qiuxiang / react-native-baidumap-sdk

React Native BaiduMap SDK for Android + iOS
MIT License
330 stars 71 forks source link

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

Closed feifeimonghuan3 closed 6 years ago

feifeimonghuan3 commented 6 years ago

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 commented 6 years ago

0.55 的配置请参考 https://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies

feifeimonghuan3 commented 6 years ago

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

qiuxiang commented 6 years ago

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

feifeimonghuan3 commented 6 years ago

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

feifeimonghuan3 commented 6 years ago

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 模块缺失的错误

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

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

YYCoder1963 commented 6 years ago

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

feifeimonghuan3 commented 6 years ago

@lyayun 你有从新 pod install 一下么

YYCoder1963 commented 6 years ago

@feifeimonghuan3 有的

feifeimonghuan3 commented 6 years ago

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