我是 iOS 新手,我的 Podfile
上已经有 Alamofire
和 MarqueeLabel
,现在正尝试添加 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/