Comments (17)
I opened an issue on the Cocoapods repo and dnkoutso helped me find a fix. 🎉
Just add this to your Podfile:
pre_install do |installer|
installer.analysis_result.specifications.each do |s|
s.swift_version = '4.2'
end
end
It will modify the spec earlier and the compilation will work.
from rome.
With CocoaPods 1.7.1, I had to update the workaround to use the new pluralized swift_versions
attribute:
s.swift_versions << '4.2' if s.swift_versions.empty?
from rome.
Update for CocoaPods 1.9.1:
- setting either
s.swift_version
ors.swift_versions
doesn't entirely do the job, as apparently both will affect the value of theswift_versions
array, butswift_version
remains nil and fails - the only solution I could find was to use
target 'XXX' do
current_target_definition.swift_version = '5.0'
end
That current_target_definition.swift_version
gets picked up and set as the Swift version for those pods that are missing the swift_version
.
I no longer need the pre_install
hook.
See CocoaPods/CocoaPods#9799
from rome.
Same issue happens with CocoaPods 1.7.0.rc.1
from rome.
Only thing that worked for me is using CocoaPods 1.5.3
, which does not work with XCode 10.2.
from rome.
I don think that is related with this project.
from rome.
I encountered the same problem. Downgrading to 1.5.3 consistently solves the issue for me.
from rome.
@Thomvis same for me.
I never got a response back from the CP team on this issue. Maybe it's related to @dnkoutso 's comment. Why do you think it's not related to this project? I described a clear scenario where the plugin doesn't function correctly with CocoaPods 1.6.0.beta.2
from rome.
Getting the same error with Cocoapods 1.6.1, downgrading to 1.5.3 also solved the issue for me.
from rome.
Unfortunately the Xcode 10.2 simulators don't work with cocoapods 1.5.3 for me. The version of fourflusher used in cocoapods 1.5.3 doesn't support xcode 10.2. And I also get the same "Alamofire
does not specify a Swift version and none of the targets" error with cocoapods 1.6.1.
from rome.
I was hoping CocoaPods 1.7.0
would fix this issue. Maybe the issue should be posted to the CocoaPods project?
from rome.
Is there any workaround?
from rome.
Has someone tried this on Cocoapods 1.7.0.rc.2
from rome.
Can confirm pre_compile
hooks are not working on Cocoapods 1.7.0.rc.2
either.
😞
from rome.
I’ve also found that the pre release version of Alamofire works. It includes the Swift version.
from rome.
Very nice @Unknoob - appreciate your solution
from rome.
Update and weird case: if anyone still sees the error after applying the fix above
[!] Unable to determine Swift version for the following pods:
- `POD_XXX` does not specify a Swift version and none of the targets (`targetname`) integrating it have the `SWIFT_VERSION` attribute set. Please contact the author or set the `SWIFT_VERSION` attribute in at least one of the targets that integrate this pod.
it might be because they are only explicitly picking subspecs from a pod in their Podfile
and this leads to installer.analysis_result.specifications
not containing the target for the Pod.
Example
pod 'OHHTTPStubs/Swift', version
pod 'OHHTTPStubs/HTTPMessage', version
pod 'OHHTTPStubs/Mocktail', version
and the simple fix is just explicitly adding the pod without any subspec
pod 'OHHTTPStubs', version
from rome.
Related Issues (20)
- My Podfile serves ios and macOS apps, can't integrate rome.
- Fails in `integrate_targets=` HOT 2
- Issues installing HOT 6
- `pod install` fails if pod not used by concrete target HOT 2
- Space character in project path is not supported (was: lipo failure with Xcode 9) HOT 5
- Specifying xcconfig params (such as SWIFT_VERSION) for individual pods HOT 3
- Error when trying to build the sample HOT 1
- x86_64 architecture is missing from built frameworks HOT 5
- Bundles are not placed to Rome folder HOT 3
- Rome crashes with cocoapods 1.5.2 HOT 5
- Xcode 10 Building frameworks failing HOT 6
- Issues with adding firebase through rome HOT 6
- Need support to static framework HOT 2
- Static frameworks with resource_bundles
- Unknown configuration whitelisted: fabric. CocoaPods found debug and release, did you mean one of these HOT 1
- gemspec is locked to cocoapods `=1.8.0.beta.1`
- Is Rome still actively supported? HOT 2
- Error Swift_Version missing HOT 1
- simulator build produces _CodeSignature directories HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rome.