CocoaPods - Unable to find a specification for `GoogleMaps`

15,306

Solution 1

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

Solution 2

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.

Solution 3

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!!

Share:
15,306

Related videos on Youtube

Wasif Khalil
Author by

Wasif Khalil

Updated on May 15, 2022

Comments

  • Wasif Khalil
    Wasif Khalil 13 days

    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?

  • Wasif Khalil
    Wasif Khalil over 5 years
    it still says [!] Unable to find a specification for GoogleMaps
  • guidev
    guidev over 5 years
    @WasifKhalil really strange. Try running this on your terminal "pod try GoogleMaps"
  • Wasif Khalil
    Wasif Khalil over 5 years
    when i try pod update or pod try googlemaps it does this and gets stuck pod try GoogleMaps Updating spec repositories fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.....
  • Wasif Khalil
    Wasif Khalil over 5 years
    i have been trying this, does it take time to finish? when i run pod setup --verbose it is showing "Cloning spec repo master from https://github.com/CocoaPods/Specs.git (branch master) $ /usr/bin/git clone github.com/CocoaPods/Specs.git master Cloning into 'master'..." its been 5 min, not sure if it is doing something in background or stuck
  • guidev
    guidev over 5 years
    Don't worry, it takes like 10 minutes or more to finish.
  • Rivers
    Rivers almost 5 years
    This solution works for me: pod repo remove master pod setup
  • Nitesh
    Nitesh over 4 years
    pod repo remove master pod setup this worked for me.