Pod GoogleMaps无法正常工作

我知道这是非常基本的,但不能debugging的问题。 这是我的Podfile。

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

我从这里选了这个 当我尝试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>' 

重新开始:

  1. 创build一个新的,干净的Xcode项目
  2. pod init
  3. Podfile添加下面的Podfile
  4. pod install

Podfile

 source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.1' target 'SO-32079263' do pod 'GoogleMaps' end 

荚安装 testing与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 rm -rf Pods/ Podfile Podfile.lock ; pod init

这对我有效

  • 安装cocoa豆荚

    sudo gem安装cocoapods

  • 创build一个新的Xcode项目(项目名称示例:我的项目)
  • 转到项目文件夹并使用名称Podfile创build一个新文件
  • 打开pod文件并input下面的configuration – 将“我的项目”更改为您的项目名称。

>

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

在terminal中,导航到项目文件夹并键入pod install

荚安装

 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. 

尝试了很多东西后,这里是修复!

Imp:确保在你的PodFile中有这些行

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

如果上述情况良好,则需要更新Pod:请尝试以下步骤:

  1. 打开一个新的terminal并在临时目录中运行以下命令。

    pod try GoogleMaps

保持耐心! 这将需要一些时间,但会更新吊舱。

  1. 现在尝试再次在你的项目中安装pod。 它应该工作。请尝试在项目目录中运行以下命令:

pod repo update

再试一次。 在任何问题的情况下评论!