Compilation fails with Swift 3 #182

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

Comments

Projects
None yet
@saghul
Member

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

This comment has been minimized.

Show comment
Hide comment
@ibc

ibc Jul 1, 2016

Member

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

Member

ibc commented Jul 1, 2016

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

@warrenjmcdonald

This comment has been minimized.

Show comment
Hide comment
@warrenjmcdonald

warrenjmcdonald 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
.

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 referenced this issue Sep 14, 2016

Closed

iOS10 support #205

@francois-n-dream

This comment has been minimized.

Show comment
Hide comment
@francois-n-dream

francois-n-dream 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'

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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Sep 21, 2016

Member

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

Member

saghul commented Sep 21, 2016

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

@francois-n-dream

This comment has been minimized.

Show comment
Hide comment
@francois-n-dream

francois-n-dream Sep 21, 2016

@saghul Yes, its set to Yes for both

@saghul Yes, its set to Yes for both

@n-dream

This comment has been minimized.

Show comment
Hide comment
@n-dream

n-dream 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.

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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Sep 23, 2016

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@francois-n-dream

francois-n-dream 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!

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

This comment has been minimized.

Show comment
Hide comment
@raphagodoi

raphagodoi 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 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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Sep 26, 2016

Member

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

Member

saghul commented Sep 26, 2016

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

@francois-n-dream

This comment has been minimized.

Show comment
Hide comment
@francois-n-dream

francois-n-dream 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

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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Sep 29, 2016

Member

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.

Member

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.

Show comment
Hide comment
@menelike

menelike Oct 26, 2016

Contributor

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)

Contributor

menelike commented Oct 26, 2016

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)

@mikkelking

This comment has been minimized.

Show comment
Hide comment
@mikkelking

mikkelking 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)

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.

Show comment
Hide comment
@menelike

menelike Oct 27, 2016

Contributor

@mikkelking great news, thanks a lot!

Currently we try to dance the meteor downgrade mambo jambo to METEOR@1.4.1.3. So far this is our webapp fork, still on swift 2.3 with minor fixes for Xcode 8 https://github.com/risetechnologies/cordova-plugin-meteor-webapp/commits/swift2.3

We added this as a local cordova plugin, in addition we had to downgrade

webapp@=1.3.11_1
mongo@=1.1.13

accounts-password@1.3.0 might need to be downgraded as well.

Not sure if this will succeed, anyway this is just a temporary solution.

Update:

We could make this work with Meteor 1.4.2 and all packages up to date. This commit explains how risetechnologies/cordova-plugin-meteor-webapp@2f78c60

This line inside cordova-plugins should do the trick

cordova-local-notfication-plugin@https://github.com/risetechnologies/cordova-plugin-meteor-webapp.git#2f78c6030b17b107aaec2caa222acd729320d8e0

sorry guys, this conversation should have been done in the mailing list

Contributor

menelike commented Oct 27, 2016

@mikkelking great news, thanks a lot!

Currently we try to dance the meteor downgrade mambo jambo to METEOR@1.4.1.3. So far this is our webapp fork, still on swift 2.3 with minor fixes for Xcode 8 https://github.com/risetechnologies/cordova-plugin-meteor-webapp/commits/swift2.3

We added this as a local cordova plugin, in addition we had to downgrade

webapp@=1.3.11_1
mongo@=1.1.13

accounts-password@1.3.0 might need to be downgraded as well.

Not sure if this will succeed, anyway this is just a temporary solution.

Update:

We could make this work with Meteor 1.4.2 and all packages up to date. This commit explains how risetechnologies/cordova-plugin-meteor-webapp@2f78c60

This line inside cordova-plugins should do the trick

cordova-local-notfication-plugin@https://github.com/risetechnologies/cordova-plugin-meteor-webapp.git#2f78c6030b17b107aaec2caa222acd729320d8e0

sorry guys, this conversation should have been done in the mailing list

@soulfly

This comment has been minimized.

Show comment
Hide comment
@soulfly

soulfly Nov 2, 2016

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

soulfly commented Nov 2, 2016

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

@hk0i

This comment has been minimized.

Show comment
Hide comment
@hk0i

hk0i 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

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

This comment has been minimized.

Show comment
Hide comment
@cozzbie

cozzbie 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

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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Feb 6, 2017

Member

@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

Member

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

This comment has been minimized.

Show comment
Hide comment
@cozzbie

cozzbie 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 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

This comment has been minimized.

Show comment
Hide comment
@cozzbie

cozzbie Feb 6, 2017

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

cozzbie commented Feb 6, 2017

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

@rollsroyc3

This comment has been minimized.

Show comment
Hide comment
@rollsroyc3

rollsroyc3 Feb 20, 2017

@cozzbie how did the update work for you?

@cozzbie how did the update work for you?

@cozzbie

This comment has been minimized.

Show comment
Hide comment
@cozzbie

cozzbie Feb 20, 2017

Its working fine @rollsroyc3

cozzbie commented Feb 20, 2017

Its working fine @rollsroyc3

@stormbkk87

This comment has been minimized.

Show comment
Hide comment
@stormbkk87

stormbkk87 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.

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

This comment has been minimized.

Show comment
Hide comment
@saghul

saghul Mar 25, 2017

Member

Please test #263

Member

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