ios - CocoaPods - 无法找到 `GoogleMaps` 的规范

标签 ios google-maps cocoapods

我是 iOS 新手,我的 Podfile 上已经有 AlamofireMarqueeLabel,现在正尝试添加 GoogleMaps,它一直显示此消息,

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

我的 Podfile 看起来像这样

# Uncomment the next line to define a global platform for your project

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

target 'Migapixel' do

  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

    pod 'GoogleMaps'

    pod 'Alamofire',
        :git => 'https://github.com/Alamofire/Alamofire.git',
    :branch => 'master',
      :tag => '4.0.0'

    pod 'MarqueeLabel/Swift',
    :git => 'https://github.com/cbpowell/MarqueeLabel.git'



  # Pods for Migapixel

  post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO' end end end

  target 'MigapixelTests' do

  inherit! :search_paths
  end

  target 'MigapixelUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

我什至试过这个

pod 'GoogleMaps',
    :git => 'https://github.com/CocoaPods/Specs.git'

我做错了什么?

最佳答案

尝试删除 source 'https://github.com/CocoaPods/Specs.git' 并将 use_frameworks! 移出目标 block 。此外,您不需要为 Alamofire 和 MarqueeLabel 手动设置 git 路径。 试试这个:

platform :ios, '9.0'
use_frameworks!

target 'Migapixel' do

    pod 'GoogleMaps'
    pod 'Alamofire'
    pod 'MarqueeLabel/Swift'


  # Pods for Migapixel
end

post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO' end end end

target 'MigapixelTests' do
  inherit! :search_paths
end

target 'MigapixelUITests' do
  inherit! :search_paths
  # Pods for testing
end

编辑:

您的本地存储库似乎有问题。 尝试清理并重新安装:

pod repo remove master
pod setup

关于ios - CocoaPods - 无法找到 `GoogleMaps` 的规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41531887/

相关文章:

ios - iOS 的 Places API 未启用

ios - 无法更新 Pod。总是报错 GitHub is down

ios - 具有特定图像的 UITabBar 和 UITabBarItem @2x 适用于 iPhone 5 和 iPhone 6

ios - UIPageViewController 的 UIPageControl 在滚动到下一个 View Controller 时有时不会更新

javascript - Google map - 获取当前 map 位置的地址

xcode - Xcode 11 beta 4错误:命令CompileSwiftSources失败,退出代码为非零

swift - CocoaPods 的 Xcode 10.1 Swift 编译器错误

ios - 如果 https 服务器使用不安全的 SSL 证书托管,则限制 Web 服务调用

iphone - 是否可以将单词包装在 UITableViewSectionIndex 中?

caching - 如何缓存 Google map 图 block 以供离线使用?