gpt4 book ai didi

ios - 运行 pod install 后无法找到目标文件

转载 作者:行者123 更新时间:2023-11-29 11:42:45 26 4
gpt4 key购买 nike

我正在使用 react-native-maps 并尝试使用适用于 iOS 的 Google map ,并且我遵循了来自 https://github.com/airbnb/react-native-maps/issues/693 的上述说明这样做我从 pod 安装中得到一个错误:

无法找到名为 AirMapsExplorer 的目标

这是我的podfile

# You Podfile should look similar to this file. React Native currently does not support use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

# Change 'AirMapsExplorer' to match the target in your Xcode project.
target 'AirMapsExplorer' do

pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
pod 'React', path: '../../node_modules/react-native', :subspecs => [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'BatchedBridge'
]

pod 'GoogleMaps' # <~~ remove this line if you do not want to support GoogleMaps on iOS
pod 'react-native-maps', path: '../../'
pod 'react-native-google-maps', path: '../../' # <~~ if you need GoogleMaps support on iOS

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
end
end

我重新启动了我的设备(现在 2 次)删除了 pod 文件夹和 podfile,再次按照说明进行操作并得到了同样的错误。我什至尝试清理构建和清理文件夹仍然无济于事。

任何人都遇到过这个错误,或者在遇到这个问题时遇到了解决方法。我不经常使用 xcode,因为我正在使用 React Native 进行构建,并且尽量不使用 xcode 做太多事情,除非我绝对必须为 iOS 使用。

如果您希望我展示其他内容,我会帮助调试此问题。谢谢

最佳答案

当你开始这个项目时,你需要在你的目标中输入XCode创建的xcodeproj的名称,你还需要检查你的.podFile是否在你的xcodeproj 文件目录,我也认为你缺少这一行

workspace 'AirMapsExplorer'

这将创建一个集成了 pod 的工作区

您的 pod 文件已修改

# You Podfile should look similar to this file. React Native currently does not support use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'

workspace 'AirMapsExplorer'

# Change 'AirMapsExplorer' to match the target in your Xcode project.
target 'AirMapsExplorer' do

pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
pod 'React', path: '../../node_modules/react-native', :subspecs => [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'BatchedBridge'
]

pod 'GoogleMaps' # <~~ remove this line if you do not want to support GoogleMaps on iOS
pod 'react-native-maps', path: '../../'
pod 'react-native-google-maps', path: '../../' # <~~ if you need GoogleMaps support on iOS

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
end
end

希望对你有帮助

关于ios - 运行 pod install 后无法找到目标文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45553767/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com