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

unable to find target file after running pod install

我正在使用 react-native-maps 并尝试将 Google 地图用于 iOS,我按照 https://github.com/airbnb/react-native-maps/issues/693 中的上述说明进行操作,但我从pod 安装:

无法找到名为 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'

# 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'

这将创建一个与您的 pods 集成的工作区

您的 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

希望这对您有所帮助