代码之家  ›  专栏  ›  技术社区  ›  T. Evans

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

  •  1
  • T. Evans  · 技术社区  · 7 年前

    https://github.com/airbnb/react-native-maps/issues/693

    找不到名为的目标 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
    

    如果你遇到这个错误,任何人都会遇到这个错误或找到解决方法。我不经常使用xcode,因为我正在使用React Native进行构建,我尽量不使用xcode,除非我绝对必须使用iOS。

    如果您还有其他需要我展示的内容,我将帮助调试此问题。非常感谢。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Reinier Melian    7 年前

    你需要在目标中输入 xcodeproj 启动此项目时,您还需要检查您的 .podFile 在你的 xcodeproj 文件目录,我也认为你错过了这一行

    workspace 'AirMapsExplorer'
    

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