Closed yueguanyu closed 5 years ago
when I use pod repo update and pod install, to install the socket.io-client-swift with last version, I got still this Issue.
this is my Podfile
I don't set a swift version so if you ignore the Socket.IO-Client-Swift
it will work
Do you mean to remove the pod ‘Socket.IO-Client-Swift’, which one is with the cli: tns run ios automatically added in the Podfile?
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
Forces all your pods to use swift version 4.2 that's not needed for the socket.io pod
At first I just do tns run iOS, then I got this Error:
Socket.IO-Client-Swift
does not specify a Swift version and none of the targets (testApp
) integrating it have the SWIFT_VERSION
attribute set.
Then I try to specify the swift_version in the Podfile, but it still not work. I was under Xcode 10.0, when I use tns run iOS to run the demo, I got the same error.
Can you delete the platforms, node_modules and package-lock.json and try running the project again i'm using the package with xcode 10 and it works
I had the platforms, node_modules and package-lock.json deleted. And try running: tns run ios, and I had the Error again. As the image.
Thanks for the update
I had all the others plugins removed, and successfully run up. I guess that would be a Problem with the plugins, some plugin may use the different swift_version and not declared. I’ll try the Kombination with different official-plugins. I’ll report later!
I have changed to use another Macbook, and it passed. But with my IMAC is there always problems with the SWIFT_VERSION. I don't know why....
I got the same problem on another mac mini.
Hi, if you have the last version of Websocket.io (2.5.0) and you have updated to the latest take a look in your PodFile and chek if ther is no double declaration of swift ?
I have same error, some fix for it? [!] Unable to determine Swift version for the following pods:
- `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (`cardiologia2018`) 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.
- `StarscreamSocketIO` does not specify a Swift version and none of the targets (`cardiologia2018`) 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.
- `Toaster` does not specify a Swift version and none of the targets (`cardiologia2018`) 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.
[!] Automatically assigning platform `ios` with version `8.0` on target `cardiologia2018` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Unable to apply changes on device: d44b3a513025352f8d92a1178d66cb5840bfffd2. Error is: 'pod install' command failed..
Hi, if you have the last version of Websocket.io (2.5.0) and you have updated to the latest take a look in your PodFile and chek if ther is no double declaration of swift ?
I have no dependence Websocket.io (2.5.0), the nativescript-socketio is depend on the Socket.IO-Client-Swift on IOS.
But I have found one Declaration of swift in the Local Podspecs, like that.
I have same error, some fix for it? [!] Unable to determine Swift version for the following pods:
- `Socket.IO-Client-Swift` does not specify a Swift version and none of the targets (`cardiologia2018`) 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. - `StarscreamSocketIO` does not specify a Swift version and none of the targets (`cardiologia2018`) 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. - `Toaster` does not specify a Swift version and none of the targets (`cardiologia2018`) 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. [!] Automatically assigning platform `ios` with version `8.0` on target `cardiologia2018` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`. Unable to apply changes on device: d44b3a513025352f8d92a1178d66cb5840bfffd2. Error is: 'pod install' command failed..
No, I have not found a way to fix it, but it works on the Macbook, so I have easy change the Maschine.
Hi,
Look at the Podfile located in platforms/ios/Podfile
and see if there is tow declaration of swift, you must have this :
pod 'Socket.IO-Client-Swift', :git => 'https://github.com/triniwiz/socket.io-client-swift.git'
If you have tow declarations of swift, keep pod 'Socket.IO-Client-Swift', :git => 'https://github.com/triniwiz/socket.io-client-swift.git'
and delete the other one then rebuild
or run :
rm -Rf platforms hooks node_modules
tns install
@kefahB I have this in podfile pod 'Socket.IO-Client-Swift', '~> 11.0'
, If i change to your suggest, I save it and after delete platforms where is saved my changes?
Hi @maganius,
you have just to comment this and add pod 'Socket.IO-Client-Swift', :git => 'https://github.com/triniwiz/socket.io-client-swift.git'
BUT ensure that you have the latest
if the error still run
rm -Rf platforms hooks node_modules
tns install
I fixed it with a fresh installation of nativescript and put my files in the new installation. I dont know why this way work, but im happy : )
Both these answers on StackOverflow fixed my issue. I was having the same issue. I tried reinstalling Nativescript and updating brew etc.... Downgrading cocopods worked for me and also putting export SWIFT_VERSION=3
in command terminal fixed it
https://stackoverflow.com/questions/53009550/swift-version-nativescript
It should be fixed now to use swift 4 you will need to nuke the project
Everything works for me if I set
export SWIFT_VERSION=3
However if not set, or set to 4, the app will not run. Even with a fresh build after a new npm install.
What do I need to pull a new version of, and what version, to get the fix for swift 4?
@mmccaff u need to delete the platforms directory
Fresh install today and I got the exact same problem.
The stackoverflow link (cocoapods 1.6.0 to 1.5.3) fixe the problem.
cocoapods 降低到1.5.3解决了我的问题
I am getting errors when following the stack overflow link. Minimum required version for cocoa pods is 1.6.0.
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
tns plugin add nativescript-socketio then i had platform unspecified Error. Then i change my Podfile to this: use_frameworks! platform :ios, '10.0'
target "testApp" do
Begin Podfile - /Users/mac/develop/gitstore/apps/testApp/node_modules/nativescript-socketio/platforms/ios/Podfile
pod 'Socket.IO-Client-Swift', '~> 12.0.0'
End Podfile
end
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4.2' end end end
But I got always another problem:
Socket.IO-Client-Swift
does not specify a Swift version and none of the targets (testApp
) integrating it have theSWIFT_VERSION
attribute set. Please contact the author or set theSWIFT_VERSION
attribute in at least one of the targets that integrate this pod.\n-Starscream
does not specify a Swift version and none of the targets (testApp
) integrating it have theSWIFT_VERSION
attribute set. Please contact the author or set theSWIFT_VERSION
attribute in at least one of the targets that integrate this pod.I had added the follows to my Podfile, but it still not work, even I change the SWIFT_VERSION = '3.0'. post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4.2' end end end
Is there any code involved?
I cannot open my project with Xcode 10 correctly, so I cannot set the SWIFT_VERSION with the Editor's build setting.