运行pod安装后无法找到目标文件

问题描述:

我正在使用react-native-maps,并试图使用Google Maps for iOS,并且我遵循https://github.com/airbnb/react-native-maps/issues/693的上述说明来执行此操作,因此我从pod安装中收到错误:运行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次了)删除荚文件夹和podfile,按照说明操作,得到同样的错误。我甚至尝试做干净的生成和干净的文件夹仍然无济于事。

任何人都有这个错误或遇到一种方法来解决,如果你碰到这个。我不会经常使用xcode,因为我正在使用React Native进行构建,并且尽量不使用xcode,除非我绝对需要iOS。

如果还有其他事情要我显示,我将帮助调试此问题。谢谢

+0

你以前用过cocoapods吗? –

你需要把你的目标,当你开始这个项目由的XCode创建的xcodeproj的名字,你还需要检查你的.podFile在你xcodeproj文件目录,我也认为你缺少这一行

workspace 'AirMapsExplorer' 

这将创建一个与你的豆荚工作区综合

您的吊舱文件修改

# 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 

希望这会有帮助

+1

@ReinierMelian ...不,我之前没有用过可可豆荚。这实际上是第一次使用它们。显然,需要一些更新的安装步骤来让这个工作,他们忘了,但你的上面的例子帮助。我确实必须将目标更改为“我的项目名称”,但实际上这是解决此解决方案的开始。感谢您的帮助! –

+0

@ T.Evans您的欢迎,我很高兴能够帮助您,愉快的编码和最诚挚的问候 –