我目前正在尝试让我的应用程序在 VS AppCenter 中构建,但遇到了困难。这是一个 react-native 项目,通过 cocoapods 引入了一些依赖项。
一切都在本地构建良好(干净的虚拟机上的干净克隆)
虽然我在 AppCenter 的 CI 环境中遇到以下错误:
ld:警告:找不到选项“-L/Users/vsts/Library/Developer/Xcode/DerivedData/projectname-adroxiklvgljuicvfqowylcdxjrt/Build/Intermediates.noindex/ArchiveIntermediates/unisafe/BuildProductsPath/Release-iphoneos/BVLinearGradient”的目录
ld:找不到 -lGoogle-Maps-iOS-Utils 的库
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
存档失败
我多次收到每个 pod 的第一个警告。
这是我的 Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
project './projectname.xcproj'
target 'projectname' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for projectname
pod 'AppCenter/Push', '~> 1.10.0'
pod 'AppCenter/Crashes', '~> 1.10.0'
pod 'AppCenter/Analytics', '~> 1.10.0'
pod 'AppCenterReactNativeShared'
rn_path = '../node_modules/react-native'
rn_maps_path = '../node_modules/react-native-maps'
pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
pod 'React', path: rn_path, subspecs: [
'ART',
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
]
pod 'react-native-maps', path: rn_maps_path
pod 'react-native-google-maps', path: rn_maps_path # Remove this line if you don't want to support Google Maps on iOS
pod 'GoogleMaps' # Remove this line if you don't want to support Google Maps on iOS
pod 'Google-Maps-iOS-Utils' # Remove this line if you don't want to support GoogleMaps on iOS
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-background-timer', :path => '../node_modules/react-native-background-timer'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'
pod 'TouchID', :path => '../node_modules/react-native-touch-id'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
platform :ios, '11.0'
# target 'projectnameTests' do
# inherit! :search_paths
# # Pods for testing
# end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
end
end
if target.name == "React"
target.remove_from_project
end
end
end
在我的图书馆搜索路径中,我有:
$(inherited)
$(BUILD_DIR)/${CONFIGURATION}$(EFFECTIVE_PLATFORM_NAME)
"${PODS_ROOT}"
任何想法将不胜感激。谢谢。
最佳答案
这不是一个完美的解决方案...但通过在 XCode build设置中删除并重新添加“链接的框架和库”下的所有内容来解决此问题。
我将关闭此问题,但如果其他人有此问题,请在此处回复或 PM - 很乐意提供帮助。
关于react-native - React Native 0.57 + CocoaPods - 无法仅在 CI 环境中定位链接库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53087504/