简体   繁体   中英

CocoaPods - Unable to find a specification for `GoogleMaps`

I'm new to iOS, i already have Alamofire and MarqueeLabel on my Podfile and now trying to add GoogleMaps , it keeps showing this message,

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

My Podfile looks like this

# 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

i even tried this

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

What am i doing wrong?

i resolved the issue like that with these step:

  1. open terminal.
  2. go to your project path.
  3. type:

    pod repo update

  4. install pod again.

Try removing source 'https://github.com/CocoaPods/Specs.git' and moving use_frameworks! out of the target block. Moreover you don't need to manually set the git path for both Alamofire and MarqueeLabel. Try this:

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

Edit:

It seems that there's something wrong with your local repo. Try cleaning and reinstalling:

pod repo remove master
pod setup

After trying many things Here is the fix!!

Imp: Make sure that you have these lines in your PodFile

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

If the above is fine then you need to update the pods: try the following steps:

  1. Open a new terminal and run the following command in a temp directory.

    pod try GoogleMaps

keep patience! It will take some time but will update the pod.

  1. Now try to install the pod in ur project again. It should work.Else try to run the following commands in the project dir:

pod repo update

try again. Comment in the case of any issue!!

Go to your project directory and delete pods folder and .lock file then run

pod repo update

it helps for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM