2015-08-18 26 views
1

我知道這是非常基本的,但無法調試問題。這是我的Podfile。Pod GoogleMaps不工作

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '8.1' 
pod 'GoogleMaps' 

我從here中挑選這個。當我嘗試pod install,我得到

[!] Unable to find a specification for `GoogleMaps` 

詳細的說:

Preparing 

Updating local specs repositories 

Updating spec repo `master` 
    $ /usr/bin/git pull --ff-only 
    Already up-to-date. 

Analyzing dependencies 

Inspecting targets to integrate 
    Using `ARCHS` setting to build architectures of target `Pods`: (``) 

Finding Podfile changes 
    - GoogleMaps 

Resolving dependencies of `Podfile` 
[!] Unable to find a specification for `GoogleMaps` 

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:388:in `handle_resolver_error' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:69:in `rescue in resolve' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/resolver.rb:56:in `resolve' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:535:in `block in resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:59:in `section' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:533:in `resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer/analyzer.rb:70:in `analyze' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:210:in `analyze' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:133:in `block in resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/user_interface.rb:59:in `section' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:132:in `resolve_dependencies' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/installer.rb:104:in `install!' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:71:in `run_install_with_update' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command/project.rb:101:in `run' 
/Library/Ruby/Gems/2.0.0/gems/claide-0.9.1/lib/claide/command.rb:312:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/lib/cocoapods/command.rb:48:in `run' 
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.38.2/bin/pod:44:in `<top (required)>' 
/usr/bin/pod:23:in `load' 
/usr/bin/pod:23:in `<main>' 
+0

當你嘗試做一個'pod search GoogleMaps'時會發生什麼?我將你的確切Podfile複製到一個新項目上,並能夠成功運行'pod install'。 – Tony

+0

你是如何解決你的問題的?建議的答案是否適合你? – SwiftArchitect

回答

7

重新開始:

  1. 創建一個新的,乾淨的Xcode項目
  2. pod init
  3. 廣告d低於線Podfile
  4. pod install

Podfile

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '8.1' 

target 'SO-32079263' do 
pod 'GoogleMaps' 
end 

吊艙安裝 與0.37.1

Analyzing dependencies 

Downloading dependencies 
Installing GoogleMaps (1.10.1) 
Generating Pods project 
Integrating client project 
測試

減新鮮:(見Jatin評論)

替代步驟2:rm -rf Pods/ Podfile Podfile.lock ; pod init

+0

只要刪除目錄中存在的podfile。然後按照上述步驟。 – jatin

3

這爲我工作

  • 安裝可可豆莢

    sudo的創業板安裝的CocoaPods

  • 創建一個新的Xcode項目(項目名稱例如:我的項目)
  • 轉到項目文件夾,並創建一個新的文件名爲Podfile
  • 打開莢文件輸入下面的配置 - 將「我的項目」更改爲您的項目名稱。

>

source 'https://github.com/CocoaPods/Specs.git' 
target 'My Project' do 
pod 'GoogleMaps' 
end 

在終端,導航到項目文件夾,然後鍵入吊艙安裝

吊艙安裝

Analyzing dependencies 
Downloading dependencies 
Using GoogleMaps (1.13.2) 
Generating Pods project 
Integrating client project 
Sending stats 
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed. 
+0

太棒了!就像一個魅力感謝:) –

+0

不客氣。 @NareshReddyM – deepakssn

0

嘗試很多東西這裏是後該固定!!

小鬼:確保你有你的PodFile

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '8.0' 
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do 
    pod 'GoogleMaps' 
end 

這些線路如果上面是好的,那麼你需要更新莢: 嘗試以下操作:

  1. 打開新的終端並在臨時目錄中運行以下命令。

    pod try GoogleMaps

保持耐心!這將需要一些時間,但會更新吊艙。

  1. 現在嘗試再次在ur項目中安裝pod。它應該work.Else嘗試在項目目錄運行以下命令:

pod repo update

再試一次。 評論在任何問題的情況下!