Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lint Error for pod library Swift 4 Xcode 9

I'm creating a pod for my swift 4 for library.

I run pod lib create IntentedLibraryName which generates the workspace. Then I did the necessary modifications to the files IntentedLibraryName.podspec, and moving my library swift files to the path IntentedLibraryName/Classes/.

To test out if the pod works, I've Build and pod install from the Example project and everything works as intended.

Now, I run pod lib lint IntentedLibraryName.podspec --verbose then I got

(1 failure) === BUILD TARGET IntentedLibraryName OF PROJECT Pods WITH CONFIGURATION Release ===

Check dependencies The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor. The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor

I did the following hoping it would fix it:

In the Pod project, From Build Settings > Swift Compiler- Language > Swift Language Version from Swift unspecified to Swift 4.0.

I added and committed all changes along the tag (i.e git tag 0.0.1) and push all it with --tags. (i.e git push -u origin dev --tags)

I run the linting command again, and still the same issue.

I even try toecho 4.0 > .swift-version save all commit and push it again. NADA

Also tried s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' } NADA

## CocoaPods Environment

ℹ Please replace this with the output of `pod env`.
e.g. via `pod env | pbcopy`
### Stack

```
   CocoaPods : 1.4.0.beta.1
        Ruby : ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]
    RubyGems : 2.5.1
        Host : Mac OS X 10.12.6 (16G1023)
       Xcode : 9.0 (9A235)
         Git : git version 2.8.1
Ruby lib dir : /Users/lamour/.rvm/rubies/ruby-2.3.0/lib
Repositories : bahlo - https://github.com/bahlo/SwiftGif @ d26325392aefe7822dea79a757d4e300c694d010
               master - https://github.com/CocoaPods/Specs.git @ f2169476eead8b1a9d898ff73c5eba516504ed78
```

### Installation Source

```
Executable Path: /Users/lamour/.rvm/gems/ruby-2.3.0/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.3.0
cocoapods-try         : 1.1.0
```

Project that demonstrates the issue

Please link to a project we can download that reproduces the issue. You can delete this section if your issue is unrelated to build problems, i.e. it's only an issue with CocoaPods the tool.

I do think its an issue with Xcode 9.0 because I've created empty project, still same thing happened.

Thanks for the help :)

Issue Fixed

The issue had nothing to do with Xcode 9 but it was with cocoapods. I did uninstall cocoapods from my machine and install it again. Once you done make sure you had the echo 4.0 > .swift-version. Voila :)

like image 513
Lamour Avatar asked Oct 03 '17 15:10

Lamour


1 Answers

echo 4.0 > swift-version

should be

echo 4.0 > .swift-version

right (NB the leading dot)?

I had the same problem and for whichever reason, in my .swift-version file there was a strange

2.4 =>

in it (sic).

After I changed it to

4.0

, everything worked.

Example project here:

https://github.com/karstengresch/CleanroomLogger (actually a dumb fork of CleanRoomLogger which I want to use with Cocoapods).

like image 69
gresch Avatar answered Nov 07 '22 06:11

gresch