简体   繁体   中英

Error while installing cocoa pods

While I am installing cocoa pod in my system, I got following error.

Error :

"[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named master-1 . You can try adding it manually in ~/.cocoapods/repos or via pod repo add ."

pod file:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Demo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for Demo

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

  target 'DemoUITests' do
    inherit! :search_paths
    # Pods for testing
  end
 pod 'AZSClient'
  pod 'CardIO'
  pod 'Google/Analytics'
  pod 'OpenTok'
  pod 'THCalendarDatePicker', '~> 1.2.6'
end

Write the pod file using these lines:

platform :ios, '10.0'
target “GoogleAnalyticsTestApp” do
   pod 'GoogleAnalytics'
end

Do not write Google/Analytics . Write GoogleAnalytics . Hope it will solve the problem.

I got the same issue and some times it just happened by the mismatch version of the required cocoa and cocoa pod.

My solution is as follows :

pod repo remove master
pod setup
pod install

If you still follow any issue then let me know.

Change your pod file with this:

`# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Demo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for Demo

 pod 'AZSClient'
  pod 'CardIO'
  pod 'Google/Analytics'
  pod 'OpenTok'
  pod 'THCalendarDatePicker', '~> 1.2.6'
end`

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

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

You can't use target in target.

Try this.

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Demo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for Demo
  pod 'AZSClient'
  pod 'CardIO'
  pod 'Google/Analytics'
  pod 'OpenTok'
  pod 'THCalendarDatePicker', '~> 1.2.6'

end

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

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

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