ios CocoaPods -找不到“GoogleMap”的规范

pkln4tw6  于 2023-02-26  发布在  iOS
关注(0)|答案(4)|浏览(154)

我是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'

我做错了什么?

csga3l58

csga3l581#

尝试删除source 'https://github.com/CocoaPods/Specs.git'并将use_frameworks!移出目标块,而且你不需要手动设置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
nhhxz33t

nhhxz33t2#

我用这些步骤解决了这样的问题:
1.开放终端。
1.转到您的项目路径。
1.类型:
pod repo update
1.再次安装pod。

5us2dqdw

5us2dqdw3#

在尝试了很多事情之后,这里是解决办法!!

    • 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.打开一个新终端,并在临时目录中运行以下命令。
pod try GoogleMaps
保持耐心!这需要一些时间,但会更新吊舱。
1.现在尝试在你的项目中安装pod。它应该可以工作。否则尝试在项目目录中运行以下命令:
pod repo update
请重试。2如有任何问题请发表评论! 3!

m3eecexj

m3eecexj4#

转到您的项目目录并删除pod文件夹和.lock文件,然后运行

pod repo update

对我有帮助。

相关问题