Cocoapods: pod lib create doesn't pass the lint for ObjC only pod

Created on 21 Jan 2017  ·  11Comments  ·  Source: CocoaPods/CocoaPods

This relates to: https://github.com/CocoaPods/pod-template/issues/197

Report

What did you do?

ℹ pod lib create MyLib

With options, Language: ObjC,Demo:YES, Test Framework: Specta, View Based testing: NO, class prefix: JG

What did you expect to happen?

ℹ To pass the lint

What happened instead?

ℹ The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a .swift-version file to set the version for your Pod. For example to use Swift 2.3, run:
echo "2.3" > .swift-version.

When doing so the lint passed even though I don't have any swift files in my project

CocoaPods Environment

Stack

   CocoaPods : 1.1.1
        Ruby : ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
    RubyGems : 2.6.8
        Host : Mac OS X 10.12.2 (16C67)
       Xcode : 8.2.1 (8C1002)
         Git : git version 2.10.1 (Apple Git-78)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 2f3dff7bae955ff71a224d45db8ee0ecbced3274

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.1
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.1.1
cocoapods-try         : 1.1.0

https://github.com/jugutier/JGAlgorithms/commit/0b1183aac1b5cca831f9844111dccbfdb90969c2

Most helpful comment

Seems like a simulator crash problem, not sure how the swift file is relevant, but it looks like its trying to boot a 7.3.1 simulator...

You should do xcodebuild -version to see what version on your terminal is being used. Also try
sudo xcode-select -s /Applications/Xcode.app/ to switch between xcode versions in terminal and try again.

All 11 comments

I just cloned your repo and ran pod lib lint --verbose and it worked:

** BUILD SUCCEEDED **

 -> JGAlgorithms (0.1.0)

JGAlgorithms passed validation.

Are you at https://github.com/jugutier/JGAlgorithms/commit/0b1183aac1b5cca831f9844111dccbfdb90969c2 ?

I patched it in https://github.com/jugutier/JGAlgorithms/commit/32984a42acc0c0db50ee103cba318a5af049d20e with the .swift-version file so that it would pass.

On Jan 21, 2017, at 12:22 PM, Dimitris Koutsogiorgas notifications@github.com wrote:

I just cloned your repo and ran pod lib lint --verbose and it worked:

* BUILD SUCCEEDED *

-> JGAlgorithms (0.1.0)

JGAlgorithms passed validation.```

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/CocoaPods/CocoaPods/issues/6428#issuecomment-274275056, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtmGQGabzzQCb6HBIiBd1jy4pz2EG1jks5rUj7hgaJpZM4LqHRP.

Yes I was at 0b1183aac1b5cca831f9844111dccbfdb90969c2

Xcode 8 (not 8.2) and CocoaPods version 1.2.0.rc.1

Thanks Dimitiris.

This became interesting:

After running your —verbose command it will work when doing pod lib lint JGAlgorithms.podspec

Even in the commit version in which I flagged the error. Now I tried creating another library from the template

pod lib create MyLib

What language do you want to use?? [ Swift / ObjC ]

objc

Would you like to include a demo application with your library? [ Yes / No ]

yes

Which testing frameworks will you use? [ Specta / Kiwi / None ]

specta

Would you like to do view based testing? [ Yes / No ]

no

What is your class prefix?

JG

Right after that

pod lib lint MyLib.podspec

will fail.

Then

pod lib lint —verbose

will also fail with this error

[!] MyLib did not pass validation, due to 2 warnings (but you can use --allow-warnings to ignore them).
[!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a .swift-version file to set the version for your Pod. For example to use Swift 2.3, run:
echo "2.3" > .swift-version.
You can use the --no-clean option to inspect any issue.

Please try creating a new pod to see if you also find the issue but using the pod lib lint MyPod.podspec , this is the command recommended by the MyPod.podspec template in "Be sure to run …”

Thanks!!

On Jan 21, 2017, at 12:26 PM, Dimitris Koutsogiorgas notifications@github.com wrote:

Yes I was at 0b1183aac1b5cca831f9844111dccbfdb90969c2


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/CocoaPods/CocoaPods/issues/6428#issuecomment-274275246, or mute the thread https://github.com/notifications/unsubscribe-auth/ACtmGWJCfkgBhJt26Va9FBlMt9urR78Bks5rUj-2gaJpZM4LqHRP.

This swift error might not be relevant and it always shows up when lint fails, can you please scroll up further in the verbose logs and see if there is something else wrong?

Ok So in the new pod lib create MyLib I was missing the valid git url and comment (silly me).

Earlier on my own project the error message was:

  • ERROR | [iOS] unknown: Encountered an unknown error (757: unexpected token at '2017-01-21 11:14:14.404 simctl[25749:2828634] CoreSimulator is attempting to unload a stale CoreSimulatorService job. Detected Xcode.app relocation or CoreSimulatorService version change. Framework path (/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (338.16) does not match existing job path (/Applications/Xcode 7.3.1.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc) and version (209.19).
    2017-01-21 11:14:14.660 simctl[25749:2828634] Failed to locate a valid instance of CoreSimulatorService in the bootstrap. Adding it now.
    ') during validation.

But after adding the .swift-version it got fixed... I have multiple versions of xCode installed but I wonder why the simulator would have anything to do with the pod validation to begin with..

Thoughts?

Seems like a simulator crash problem, not sure how the swift file is relevant, but it looks like its trying to boot a 7.3.1 simulator...

You should do xcodebuild -version to see what version on your terminal is being used. Also try
sudo xcode-select -s /Applications/Xcode.app/ to switch between xcode versions in terminal and try again.

I see. @dnkoutso sorry for the late response. I wasn't able to reproduce the issue again so I think I'll put this on hold. Do you know off hand if the linting process involves creating a simulator build? Otherwise I wouldn't see how this error makes sense.

Alternatively, would it make more sense that the lint error message is the final output? (i.e displaying the fatal error after the warnings) This seems to be what got me into this incorrect prognosis to begin with and it could probably help others.

@jugutier you are overall correct that the swift lint error message is deceiving. I might be addressing this but as far as this issue is concerned I am going to close it as I don't think its a cocoapods library issue.

Please feel free to re-open if you think this is a mistake!

FIXED : I've just added a summary which was blank string s.summary = ''.

TL;DR
That error is deceiving. Use --verbose to get more info and check if you have any other errors. That swift error is deceiving.

Was this page helpful?
0 / 5 - 0 ratings