Cocoapods: Not a clean project

Created on 29 Oct 2014  Β·  19Comments  Β·  Source: CocoaPods/CocoaPods

I am running a private pod. Spec has been created and I am running this command;

pod repo push WHCore WHCore.podspec --verbose

However right at the last minute spits this out;

* BUILD SUCCEEDED *

-> WHCore (0.0.1)

[!] The repo WHCore is not clean

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command/repo/push.rb:109:in check_repo_status' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command/repo/push.rb:43:inrun'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:271:in run' /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/lib/cocoapods/command.rb:50:inrun'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.4/bin/pod:33:in <top (required)>' /usr/bin/pod:23:inload'
/usr/bin/pod:23:in `

'

awaiting input

Most helpful comment

Doh! It’s complaining about the spec-repo to which you are trying to push the spec. My bad.

So if you change to ~/.cocoapods/repos/WHCore and run git status there, it should probably show the real issue.

All 19 comments

That indicates that the WHCore repo is not clean. I’m not sure what you mean is the problem here, please elaborate.

Can you elaborate what determines an un-cleaned repository? I have never heard of this before

Assuming you are using git for that repo, can you run git status? If the repo is clean it would say something like nothing to commit, working directory clean.

I get:

0.0.1
nothing to commit, working directory clean

On git status

Sorry, can you run git status --porcelain, that’s the exact command it runs https://github.com/CocoaPods/CocoaPods/blob/master/lib/cocoapods/command/repo/push.rb#L108.

Just run that command but it doesn't reply with anything

Well that’s weird, because it checks wether or not the repo is clean by checking if there is any output at all. To be sure, can you perform the following?

$ irb
irb(main):001:0> `git status --porcelain  2>&1` == ''
=> true

Yes correct, I get => true as above example

Wow, I’m not sure what is going on here then.

Can it be that you made any repo changes since? Can you run pod repo push WHCore WHCore.podspec --verbose once more to be sure?

It's a strange one, been pulling my hair out with this!

Tried but still the same, here is the pod spec (apart from company details which I have cut out);

 s.license      = { :type => 'Apache License, Version 2.0', :text => <<-LICENSE
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
      LICENSE
    }
  # s.license      = { :type => "MIT", :file => "FILE_LICENSE" }


  # ――― Author Metadata  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the authors of the library, with email addresses. Email addresses
  #  of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
  #  accepts just a name if you'd rather not provide an email address.
  #
  #  Specify a social_media_url where others can refer to, for example a twitter
  #  profile URL.
  #

  s.author             = "Adam Rush"
  # Or just: s.author    = ""
  # s.authors            = { "" => "" }
  # s.social_media_url   = "http://twitter.com/"

  # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If this Pod runs only on iOS or OS X, then specify the platform and
  #  the deployment target. You can optionally include the target after the platform.
  #

  # s.platform     = :ios
  s.platform     = :ios, "7.0"

  #  When using multiple platforms
  # s.ios.deployment_target = "5.0"
  # s.osx.deployment_target = "10.7"


  # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the location from where the source should be retrieved.
  #  Supports git, hg, bzr, svn and HTTP.
  #

  s.source       = { :git => "git@gitlab.*******-dev.local:ta-ios-dev/whcore.git", :tag => "0.0.1" }


  # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  CocoaPods is smart about how it includes source code. For source files
  #  giving a folder will include any h, m, mm, c & cpp files. For header
  #  files it will include any header in the folder.
  #  Not including the public_header_files will make all headers public.
  #

  s.source_files  = "Classes", "WHCore/Classes/*.{h,m}"
  s.source_files  = "Classes", "ThirdParty/**/*.{h,m}"
  s.exclude_files = "Classes/Exclude"

  # s.public_header_files = "Classes/**/*.h"


  # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  A list of resources included with the Pod. These are copied into the
  #  target bundle with a build phase script. Anything else will be cleaned.
  #  You can preserve files from being cleaned, please don't preserve
  #  non-essential files like tests, examples and documentation.
  #

  # s.resource  = "icon.png"
  # s.resources = "Resources/*.png"

  # s.preserve_paths = "FilesToSave", "MoreFilesToSave"


  # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Link your library with frameworks, or libraries. Libraries do not include
  #  the lib prefix of their name.
  #

  # s.framework  = "Flurry, CrittercismSDK, Airship Min, AFNetworking"
  # s.frameworks = "SomeFramework", "AnotherFramework"

  # s.library   = "iconv"
  # s.libraries = "iconv", "xml2"


  # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If your library depends on compiler flags you can set them in the xcconfig hash
  #  where they will only apply to your library. If you depend on other Podspecs
  #  you can include multiple dependencies to ensure it works.

  s.requires_arc = true

  # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
  # s.dependency "JSONKit", "~> 1.4"

end

Doh! It’s complaining about the spec-repo to which you are trying to push the spec. My bad.

So if you change to ~/.cocoapods/repos/WHCore and run git status there, it should probably show the real issue.

Perfect!

Thanks so much :) _grabs a coffee & breathes_

We probably should print out the path of the unclean repo to make it clearer

@segiddins :+1:

Great :+1:

clean = Dir.chdir(repo_dir) { `git status --porcelain  2>&1` } == ''

The validation here is not reliable if the user prefixes the pod command with proxychains command since it outputs extra log like [proxychains] DLL init to stdout:

proxychains4 irb
[proxychains] config file found: /Users/dismory/.proxychains/proxychains.conf
[proxychains] preloading /usr/local/Cellar/proxychains-ng/4.7/lib/libproxychains4.dylib
[proxychains] DLL init
[proxychains] DLL init
2.0.0-p481 :001 > clean = Dir.chdir("../../.cocoapods/repos/master") { `git status --porcelain  2>&1` } == ''
[proxychains] DLL init
 => false
2.0.0-p481 :002 >

@dismory I have encountered this problem,thanks

i have deleted the repo and add repo, it's resolved!

Doh! It’s complaining about the spec-repo to which you are trying to push the spec. My bad.

So if you change to ~/.cocoapods/repos/WHCore and run git status there, it should probably show the real issue.

great, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonu5 picture sonu5  Β·  3Comments

k06a picture k06a  Β·  3Comments

marzapower picture marzapower  Β·  3Comments

5SMNOONMS5 picture 5SMNOONMS5  Β·  3Comments

pallaviMN picture pallaviMN  Β·  3Comments