Every time I run pod lib lint file.podspec I receive this storage warning and I can't figure out how to fix it
You won't receive this warning if you are using CocoaPods 1.7.0.beta.1 or newer because the .swift-version file was deprecated, see this link for more details. Use the swift_versions attribute to specify the Swift version:
s.swift_versions = ['5.0']
The .swift-version is a file that serves as a hint for cocoapods to know which version of Swift your pod target, for the given branch/commit/tag.
The content of the file should exclusively contain the Swift version your pod targets, so 4.2 for example if you target Swift 4.2. You can easily create such a file by navigating to the podspec's folder using the Terminal app, and then write:
echo '4.2' > .swift-version
(replace 4.2 with the Swift version you target)
You can find an example of such a file on Sourcery's repository: https://github.com/krzysztofzablocki/Sourcery/blob/master/.swift-version
Related
Build system information
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'SwiftyJSON')
how can I deal with it?
SwiftyJSON v4.3.0 supports Swift 5. Check your Podfile to make sure you’re getting the latest release. You may need to update your Pods (with pod update) to make sure you’ve got the latest versions.
Also, you might consider retiring SwiftyJSON and using JSONEncoder/JSONDecoder instead. See Encoding and Decoding Custom Types or the Using JSON with Custom Types sample for more information.
If, on the other hand, you are not using Swift 5 yet, just configure your Podfile indicate that you want to use SwiftyJSON v4.2.0. E.g.
target 'MyApp' do
pod 'SwiftyJSON', '~> 4.2'
end
Either change the build target of your project to Swift 4.x or wait until the project gets support for Swift 5 (you can check that on the GitHub page)
I get this error too when i tried to pod lint or push.
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2.
I have to stay on xcode 10.1 ans use cocoapods 1.5.3, but on a fresh install (new mac) I received the same error.
Here is my solution:
After comparing my 'gem list' with an other mac, I found that the gem xcodeproj was very high (1.12.0).
So, I installed a lower version required by cocoapods (1.5.3)
"sudo gem install xcodeproj -v 1.5.7"
and remove the never
"sudo gem uninstall xcodeproj -v 1.12.0"
Wrongs fine now, I cant lint and push my pods.
I'm having trouble running swift package generate-xcodeproj. I created my package like this:
$ /Applications/Xcode9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift package init --type executable
(as I have many Xcode versions installed I explicitly targeted a swift binary when running the command so that I don't need to xcode-select all the time)
This created a Package.swift with the version header // swift-tools-version:4.0.
Now, when I run swift package generate-xcodeproj I get a fatal error:
$ /Applications/Xcode9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift package generate-xcodeproj
/Users/max.chuquimia/Desktop/xcode/MyPackage: error: manifest parse error(s):
<unknown>:0: error: Swift does not support the SDK 'MacOSX10.12.sdk'
No .xcodeproj is generated. Why is this occurring?
It seems the problem is the $DEVELOPER_DIR environment variable is wrong - it should also be made to point to the Xcode version that the swift binary resides in.
$ DEVELOPER_DIR=/Applications/Xcode9.4.1.app/Contents/Developer /Applications/Xcode9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift package generate-xcodeproj
I upgraded Xcode to 8.1 GM and am now getting the below error for SwiftyJSON. Other imported frameworks seem to work. Is there a way to force this to work in Swift 3 until SwiftyJSON upgrades their framework? I used Carthage to import/update frameworks. I also tried changing Use Legacy Swift language version On and Off to no avail.
Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1:
Modules/SwiftyJSON.swiftmodule/arm64.swiftmodule
SwiftyJson is being downloaded precompiled by carthage. The precompiled download is with Swift Version 3.0. That makes the compiler complain that the version is not correct. Using the following command:
carthage update --platform iOS --no-use-binaries
SwiftyJson (and all other frameworks within Carthage) will be compiled locally using the local version of Swift (3.0.1) and the compiler will not complain anymore.
Remove the app chache from DerivedData, and rebuild. the error may be fixed.
The DerivedData path like this:
~/Library/Developer/Xcode/DerivedData/
Make sure you've placed the new XCode 8.1 GM package in your Applications folder. We ran into this issue when one of us was running Carthage to update our dependencies, but had not replaced the XCode old 8.0 application in the applications folder (8.1 GM was running off the Desktop).
You want to make sure that when you run the following in terminal: xcrun swift -version that it returns Apple Swift version 3.0.1.
Updating default Xcode to new one on terminal worked for me.
Step 1 : Use following command to update Xcode version to latest on Terminal. Ref
sudo xcode-select -switch <path/to/>Xcode.app
Step 2 : Now try carthage update command
carthage update --platform iOS
Just to give the latest updates:
Carthage has released version 0.20 on Feb 27, 2017.
Carthage now only uses the pre-build binary if available pre-build binary is compatible.
That is being said, you no longer have to use: --no-use-binaries to avoid incompatible pre-build framework.
So make sure that you have carthage version greater than 0.20 and simply do:
carthage update --platform iOS
Just like #zirinisp said:
You can Using the following command:carthage update --platform iOS --no-use-binaries
Using the following command:xcrun swift -version to see the Swift version
Do this: Xcode->preferences->locations to clear the derived data and archives data, the most important to change the command line tools to "Xcode 8.1"
Using the following command:xcrun swift -version,you can see the swift version is 3.0.1
Set Use Legacy Swift Language Version = NO
I hope it will help you
Move the beta/GM version if the Xcode to /Applications folder and name it Xcode-beta
Check the output of:
xcrun swift --version
by running this command in terminal, its output should match with the swift version you want the app to compile, because Carthage uses output of this command, to determine the local Swift version.
Update Xcode version to latest on Terminal by running following command:
sudo xcode-select -s /Applications/Xcode-beta.app/
Build the libraries for iOS and prevents Carthage from downloading existing (yet incompatible) precompiled binaries, by running following command:
carthage update --platform iOS --no-use-binaries
Clean & Build
I had exactly the same issue with the library XCTest_Gherkin, what it worked for me was:
Product -> Scheme -> XCTest-Gherkin
Product -> Build
Hope it helps. I am using Cocoapods.
In Xcode Build Settings make sure your Framework Search Paths contain the appropriate Carthage Build folder:
$(inherited)
$(PROJECT_DIR)/Carthage/Build/iOS
I am attempting to add in the Socket Mobile ScanApiSdk into my project but it is failing to build with the error 'ScanApiHelper.h' file not found. I have installed it into my project workspace using the CocoaPods method. Unzipped the SDK into a folder at the same folder level as my project folder. Adding the following line to my Podfile.
pod 'ScanAPI', :path => '../scanapisdk'
Then ran the pod install command at prompt. Launched project from the xcworkspace file and then added the following line to my bridging header.
#import "ScanApiHelper.h"
Build fails at this line in the bridging header.
Xcode Version 8.0 (8A218a)
gem --version 2.0.14.1
pod --version 1.0.1
ScanAPI SDK Version 10.3.55
I was able to download the sample SingleEntrySwift project from Github, build it, and load it on my iPhone for testing.
Can someone help point out what I am doing wrong in my own project or troubleshooting steps?
I had this issue too and this solution worked for me.
Basically, you don't need a bridging header if you use use_frameworks!. Instead you just import ScanAPI in any swift files that use ScanAPI.
I’m upgrading a CocoaPod to Swift 3. It compiles and runs just fine, but pod lib lint fails with numerous compiler errors, because the linter tries to compile everything as Swift 2.3.
Attempts to set SWIFT_VERSION in the podspec or change “Use Legacy Swift Language Version” in my framework’s Xcode project do not solve the issue.
How do I make the pod linter use Swift 3?
It turns out CocoaPods now looks for a .swift-version file, as of 1.1.0.rc.2 (changelog). If the file contains 3.0, linting will work:
echo 3.0 > .swift-version
First you have to update cocoapods to 1.1.0.rc.2 by
[sudo] gem install cocoapods --pre
then as Paul Cantrell says, do
echo 3.0 > .swift-version
in the same dir where the pod spec is
I have this issue when develop SDK which is depending on socket.io-Client-Swift.
After type
echo 3.0 > .swift-version
still don't fix my problem.
However, I noticed pod lint use xcodebuild to test whether the framework is ready to be release without error.
Make sure you use Xcode8 to build pod lint. For some reason, I install both Xcode7 & Xcode8 and changed my xcodebuild path to xcode7, so the lint won't be pass when I want to make a framework with swift 3.
use the following code to make sure your xcode setting is right.
xcode-select -print-path
if the xcode-select path is not point to xcode8, you should using
xcode-select -switch <path>
set the xcode-select path to xcode8 which is usually in your Applications.
I know this was written for Swift 3, but you can do the same to update pods for 4.0:
echo 4.0 > .swift-version
This was done with version 1.3.1 of Cocoapods.