Unable to find a specification in CocoaPods

后端 未结 17 2442
醉酒成梦
醉酒成梦 2020-12-07 15:31

I cannot understand why the Cocoapod is unable to find the pod specification I created when I run pod install. Could someone help me solve this trouble?

相关标签:
17条回答
  • 2020-12-07 16:12

    Instead of:

    s.source       = { :git => "git@github.com:myrepo/Podspecs.git", :branch => "xyz" }
    

    Write this: Don't forget the tag...

    s.source       = { :git => "https://github.com/myrepo/Podspecs.git", :branch => "xyz",
                       :tag => s.version.to_s }
    
    0 讨论(0)
  • 2020-12-07 16:14

    With me, this worked like a charm.

    pod repo remove master
    pod setup
    

    However, you may try directly, pod setup as some users pointed.

    0 讨论(0)
  • 2020-12-07 16:14

    Update the master repo for cocoapods.

    `pod repo update master`
    
    0 讨论(0)
  • 2020-12-07 16:15

    For me it was an issue with finding the spec, not the spec itself. I needed to add a source link to the Podfile, see Podfile documentation

    Cocoapods recently added the need to link to the repo that holds the pod spec file you are looking for, the default is:

    source 'https://github.com/CocoaPods/Specs.git'
    

    You may need to add multiple source links if you are using more obscure or homemade pods.

    0 讨论(0)
  • 2020-12-07 16:15

    I was working in flutter with all public repos. I was getting a similar error:

    Unable to find a specification for `TOCropViewController (~> 2.5.2)` depended upon by `image_cropper`
    

    For some reason TOCropViewController specification was unavailable. I tried the following:

    flutter clean
    rm -Rf ios/Pods
    rm -Rf ios/.symlinks
    rm -Rf ios/Flutter/Flutter.framework
    rm -Rf ios/Flutter/Flutter.podspec
    rm ios/Podfile
    flutter run
    

    But the plugin specification was still unavailable. Finally, I solved it by removing the pod's repo master.

    pod repo remove master
    sudo rm -rf ~/.cocoapods/repos
    pod setup
    pod install
    

    To validate and confirm that the plugin is here, I tried grep inside .cocoapods, using:

     grep -r "TOCropViewController" -n ~/.cocoapods
    

    Inside ~/.cocoapods/repos/trunk/Specs/3/7/4/TOCropViewController/2.5.2/TOCropViewController.podspec.json

    I found the plugin's git repo and correct version number.

      "source": {
        "git": "https://github.com/TimOliver/TOCropViewController.git",
        "tag": "2.5.2"
      },
    

    After that flutter clean and flutter run started working.

    0 讨论(0)
提交回复
热议问题