https://stackoverflow.com/questions/46338588/xcode-9-swift-language-version-swift-version
I am seeing the above error if i use this plugin with my new ionic project
Steps to reproduce :
ionic start myApp tabs
cd myApp/
cordova plugin add cordova-plugin-iosrtc
ionic cordova platform add ios
and then ....
open the project in xcode
try to build and run the project
do i need to Convert your source code from Swift 2.0 to 3.2 using Xcode 8 and then continue with Xcode 9 (Swift 3.2 or 4).
??
The same at my side as well,
Can't use the library with Xcode9
@ibc do you still support the library?
No, sorry, I don't have time.
:(((
so looks like Xcode 9.4 is completely broken because it does not support Swift less than 3.3 anymore
That's sad, but that does not provide free time to me.
This is that exact moment when I feel like I hate open source ;-D
and I also hate Apple because they did not add the WebRTC support for iOS WebView...
Well, need to think how to prepare a PR and also find free time for it ;-D
and I also hate Apple because they did not add the WebRTC support for iOS WebView...
Indeed, Apple once again...
Beside of that I could build this project with Version 9.4.1 (9F2000), but I'm not using ionic.
Hi @menelike ,
you mean you built it from src code?
At my side, I have a simple WebRTC Web application, and now trying to run it under Cordova.
I have Xcode 9.4.1 installed which supports Swift 3.3 and newer, but can't run my project - it says it can't build it because this lib is built with older Swift version
@soulfly Sorry for not being precise. I was able to build our project (based on [email protected]) without any complaints from Xcode.
Because of some video sizing issues we're currently using cordova-plugin-iosrtc@https://github.com/jaraxasoftware/cordova-plugin-iosrtc.git#51a370d12f165b7544e88016d5a577d2837a7c54
but this should not impact the building process.
Have you set Swift Language Version to 3.3?

Thx @menelike , I tried it one more time and by some reason it works now..
I guess I made a mistake with hooks/iosrtc-swift-support.js - did not set up it properly and this was a case
@tanzeelrana I have Xcode 9.4.1 and successfully run it. Maybe you have similar case with the hook?
Hi, @soulfly, I am experiencing the same error with XCode 9. Can you describe how did you succeed running the plugin?
@dianasotirova
This is probably you did not follow the Building Steps of cordova-plugin-iosrtc
https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc/blob/master/docs/Building.md
and did not setup properly a hook hooks/iosrtc-swift-support.js
With this hook it should work without any issues, because it adds Swift 3.0 settings which this plugin supports well
I had this error because of it
@soulfly, thank you very much. Indeed, the problem was the hook was not running, because I had problems with some other plugins. Running successfully the hook fixed the problem.
any idea how to make this hook work in an ionic project? I am getting the same issue, and I am not sure how to make sure the hook runs in an ionic project. Any ideas?
@soulfly or @dianasotirova any ideas on my above issues? What is the correct way to setup the hook with an ionic project?
This is the error I get does setting teh correct hook fix this issue or were you guys talking about something else?
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
@Bobisback seems yes,
I was getting the same. Can't comment on the proper steps for setting web hook, everything is covered here
https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc/blob/master/docs/Building.md
but I can say the following as a summary:
hope this help
Thanks for the comment, I am using code 10.1 as well. I have been following the steps in the building.md file. I am just not sure where to put the hooks folder in the ionic project. Any chance you could tell me where you put your hooks folder at @soulfly?
Thanks,
Bob
I am also getting tons of swift compiler errors when I try to build the project in xcode. Like 29 of them. Is it possible to actually just convert the swift code over to the newer version? Is converting swift code an automated process?
For the record i fixed this by putting the following in the file Bridging-Header.h in the ios project.
#import "Plugins/cordova-plugin-iosrtc/cordova-plugin-iosrtc-Bridging-Header.h"
Fix explained here https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc/pull/334#issuecomment-457521904
@soulfly thanks alot for your attention works well with me now.
@Bobisback
i did that in config.xml under platform ios
<hook src="iosrtc-swift-support.js" type="after_platform_add" />
and in the root of project add iosrtc-swift-support.js file
For some reason I could not get this to work. I will try again
For some reason I could not get this to work. I will try again
You need install xcode version from october 2018. Current xcode version thorow an error
I actually got the hook to work the second time I tried. Not sure what I was missing the first time.
which xcode version are you using? 10.2?
Looks like 10.1 right now.
if you will update plugin will crash
With xcode 10.2 I need to use Swift 4+ so I get a lot of errors in iosrtc plugin !
With xcode 10.2 I need to use Swift 4+ so I get a lot of errors in iosrtc plugin !
correct. you need to use older xcode version. I tried to move pugin to swift 4 but it doesn't work anyway.
correct. you need to use older xcode version. I tried to move pugin to swift 4 but it doesn't work anyway.
Is there an option to not downgrade xcode?
There is a fork somewhere in issues comments with Swift 4.2 support
Works very good, so do not need to dance around an older Xcode version
There is a fork somewhere in issues comments with Swift 4.2 support
Works very good, so do not need to dance around an older Xcode version
Do you mean this one https://github.com/simplyrtc/cordova-plugin-iosrtc-simplyrtc ?
I already tried to do it but I still have some errors with the swift versions, specifically "Command CompileSwiftSources failed with a nonzero exit code".
You made it work? please help :)
No,
this one
https://github.com/albanonm/cordova-plugin-iosrtc
it's the same plugin, but + a commit with Swift 4.2 support
Works well with Xcode 10.2
Swift 4.2 is coming to cordova-plugin-iosrtc 5.0.0 see merged PR for details https://github.com/cordova-rtc/cordova-plugin-iosrtc/pull/363
@DaveLomber not sure how you for with simplyrtc fork.
Will ping you to test 5.0.0RC1 when available to confirm.
I think we can close this now.
You may get an error if you dont add UseModernBuildSystem=0 on ios.
"ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0
Most helpful comment
@dianasotirova
This is probably you did not follow the Building Steps of cordova-plugin-iosrtc
https://github.com/BasqueVoIPMafia/cordova-plugin-iosrtc/blob/master/docs/Building.md
and did not setup properly a hook hooks/iosrtc-swift-support.js
With this hook it should work without any issues, because it adds Swift 3.0 settings which this plugin supports well
I had this error because of it