2017-08-07 96 views
1

我正在使用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嗎? –

回答

1

你需要把你的目標,當你開始這個項目由的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您的歡迎,我很高興能夠幫助您,愉快的編碼和最誠摯的問候 –

相關問題