Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails with Swift 3 #182

Closed
saghul opened this issue Jul 1, 2016 · 25 comments
Closed

Compilation fails with Swift 3 #182

saghul opened this issue Jul 1, 2016 · 25 comments

Comments

@saghul
Copy link
Collaborator

@saghul saghul commented Jul 1, 2016

This is more a TODO item than a bug report.

Xcode 8 is in beta now, and with it comes Swift 3, which fails to compile the plugin, no surprise here. I plan to fix in the future (if nobody beats me to it).

There is a way to continue being able to compile the plugin with Xcode 8: got o Build Settings -> Use Legacy Swift Language Version -> Yes

This sets SWIFT_VERSION = 2.3 for Debug and Release targets.

@ibc
Copy link
Collaborator

@ibc ibc commented Jul 1, 2016

When a programming language advances faster than applications built on it, we have a problem...

@warrenjmcdonald
Copy link

@warrenjmcdonald warrenjmcdonald commented Jul 1, 2016

Amen to that brother Iñaki
On 1 Jul 2016 8:02 PM, "Iñaki Baz Castillo" notifications@github.com
wrote:

When a programming language advances faster than applications built on it,
we have a problem...


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#182 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AC1ksO3kLBF99F_LpMuU5Re0N0y7odWhks5qROWxgaJpZM4JC-uf
.

@saghul saghul mentioned this issue Sep 14, 2016
@francois-n-dream
Copy link

@francois-n-dream francois-n-dream commented Sep 21, 2016

setting

Build Settings -> Use Legacy Swift Language Version -> Yes

does not work for me. Any clues?

I get tons of:
[....]/cordova-plugin-iosrtc/PluginRTCTypes.swift:3:3: Use of unresolved identifier 'RTCSignalingStable'

@saghul
Copy link
Collaborator Author

@saghul saghul commented Sep 21, 2016

@francois-n-dream did you set it for all targets? (Debug and Release)

@francois-n-dream
Copy link

@francois-n-dream francois-n-dream commented Sep 21, 2016

@saghul Yes, its set to Yes for both

@n-dream
Copy link

@n-dream n-dream commented Sep 23, 2016

I'm facing the same problem as @francois-n-dream has. Just can't get it to compile. Tried a lot.

I created an empty project with just this plugin.
Set Build Settings -> Use Legacy Swift Language Version -> Yes for Project & Target in Debug & Release.

Does not compile.

@saghul
Copy link
Collaborator Author

@saghul saghul commented Sep 23, 2016

Where you able to compile it before? Last I tried with Xcode 8 (beta) it worked fine. I'll give it a go as soon as I can.

@francois-n-dream
Copy link

@francois-n-dream francois-n-dream commented Sep 23, 2016

Yes, the current app - which is currently live, uses the plugin and it was never a problem to get it working.
Thanks in advance!

@raphagodoi
Copy link

@raphagodoi raphagodoi commented Sep 26, 2016

@saghul I'm using fastlane to automate deploy.. and cordova-custom-config to add custom config to platforms...

There is a way to automate this setting? Use Legacy Swift Language Version...

@saghul
Copy link
Collaborator Author

@saghul saghul commented Sep 26, 2016

@raphagodoi I don't know how to automate that.

@francois-n-dream
Copy link

@francois-n-dream francois-n-dream commented Sep 27, 2016

We found the problem. The hook does not get executed. However we followed the instructions exactly on multiple computers. Never executed. How could this be?

The solution to get things compiled anyways was to add

#import "Plugins/cordova-plugin-iosrtc/cordova-plugin-iosrtc-Bridging-Header.h"

to platforms/ios/[PROJECT_NAME]/Bridging-Header.h

@saghul
Copy link
Collaborator Author

@saghul saghul commented Sep 29, 2016

Here is how to fix it automagically with the hook: fb77112

Note that this will make the entire project use Swift 2.3, but there is no way around that.

@menelike

This comment has been minimized.

@mikkelking
Copy link

@mikkelking mikkelking commented Oct 27, 2016

We are in the same problem space, it may need the iosrtc swift code to
be upgraded to Swift 3 - will keep you posted on what we find out (we
are just a Meteor patch version behind), and using Swift 2.3, with some
relatively small scale fixes to the IOSRTC swift code at the moment. We
can keep you posted as to what we find

On 27/10/2016 6:18 am, menelike wrote:

Our project is based on Meteor and they moved their swift code to v3
within the last release. Since we can not use swift 2.3/3 in parallel
we are stuck.

Does anyone know how to deal with this? (we need an up to date meteor)

@menelike

This comment has been minimized.

@soulfly
Copy link

@soulfly soulfly commented Nov 2, 2016

The same issue for me, but with updated fb77112 it works well

@hk0i
Copy link

@hk0i hk0i commented Nov 3, 2016

FYI, this can be automated in cordova builds. I'm using this right now as part of my build process:

echo "SWIFT_VERSION = 2.3" |tee -a platforms/ios/cordova/*.xcconfig

Edit: Side note, the -a flag will always append to the file, if that's not desired you may want to wrap that in a check using grep or something

@cozzbie
Copy link

@cozzbie cozzbie commented Feb 6, 2017

Having a major issue compiling here even after the compile downgrade to 2.3 although I get a deprecation warning. As for Swift 3.0, are the errors just syntax errors and something that will easily be fixed by just editing the files or is there more? I really don't want to be caught in some deprecation battle on the long term. But for now can I solve this. Thanks

screen shot 2017-02-06 at 9 24 53 am

@saghul
Copy link
Collaborator Author

@saghul saghul commented Feb 6, 2017

@cozzbie You can try to apply #221 if you must use Swift 3. We will update, we just didn't have time to do and test it yet :-S

@cozzbie
Copy link

@cozzbie cozzbie commented Feb 6, 2017

Thanks a lot @saghul

Now I am getting a lot of use of undeclared type errors

screen shot 2017-02-06 at 12 09 29 pm

@cozzbie
Copy link

@cozzbie cozzbie commented Feb 6, 2017

Arggghhhh...I hadnt copied all the required files. Apologies...

@rollsroyc3
Copy link

@rollsroyc3 rollsroyc3 commented Feb 20, 2017

@cozzbie how did the update work for you?

@cozzbie
Copy link

@cozzbie cozzbie commented Feb 20, 2017

Its working fine @rollsroyc3

@stormbkk87
Copy link

@stormbkk87 stormbkk87 commented Feb 22, 2017

Swift 3 updates branch -> stormbkk87/cordova-plugin-iosrtc

It's a few minor versions off though, so heads up. I've been using it, haven't found any bugs.

@saghul
Copy link
Collaborator Author

@saghul saghul commented Mar 25, 2017

Please test #263

@saghul saghul closed this Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet