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
```
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 :)
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With