Closed alanning closed 5 years ago
I'd like to work on updating this to Swift 5 and would appreciate some guidance.
Attempting to run the existing test suite results in:
$ yarn test
yarn run v1.13.0
$ ios-sim start --devicetypeid=iPhone-X
No available runtimes could be found for "iPhone X".
I would guess I need to install the cordova platform with the latest simulators (probably cordova ios@5) but I'm getting stuck on how to do that for this project.
'cordova' is included as a devDependency but $ npx cordova platforms
gives this message:
"Current working directory is not a Cordova-based project."
Any tips on getting my environment set up to run these tests?
Caveat: I'm leery of doing something like installing cordova platform 5 globally since I need to continue to develop an existing Meteor app and don't want to mess that up.
@benjamn, I know 1.8.1 is now in code freeze. And not sure about plans for 1.9.
But seems like this is a critical issue. Can you give guidance on how we can help?
Thanks for the prompt, @rj-david. I think this is not necessarily a critical issue since there exists a fairly simple workaround of reverting back to Xcode 10.1.
But now that Apple is auto-updating everyone to Xcode 10.2, it does make it a fairly widespread and visible pain-point for anyone using Meteor Cordova.
The referenced issue on Meteor proper (https://github.com/meteor/meteor/issues/10511) is probably a good place to track the overall work needed to support Xcode 10.2 since we also need to support the latest version of the underlying cordova-ios dependency and I would guess that would require further updates of the other cordova plugins that Meteor uses.
Good point about being able to still use xcode 10.1.
Hopefully, Apple won't change the minimum requirements of submission to the app store soon. It is now pegged at iOS SDK 12.1 which requires xcode 10.1: https://developer.apple.com/ios/submit/
I'm not 100% sure how the change in swift version affects the cordova plugins. I'm more concerned about plugins not managed by cordova nor meteor. I hope my hunch that it might be a lot of work to be wrong
FYI You can install Xcode 10.1 manually from Apple Developer portal: https://developer.apple.com/download/more/
As @rj-david mentioned, Apple requirements are a concern. It's just a matter of time and Swift 3 will not be accepted any more. What will happen at that point? I think it's wise to start working on supporting the latest Swift.
I got the chance to make some tests today and here is what I discovered when using xcode 10.1
My current conclusion is that changing the related files (number 2 above) to the suggested fixes will make meteor compatible to xcode swift 4.2
Nice! Were you able to get the unit tests working? I noticed CI is failing so I'm guessing the unit tests need to be updated as well.
I did not (first time making a PR). I can only deal with it on Monday as I didn't bring home my mac as it isn't my main laptop.
I checked that the changes from swift 4 to swift 5 are also very easy. But I'm not 100% sure if we don't need to update cordova-ios
FYI, Swift >= 4 breaks the hot-reload
2019-04-02 18:15:21.652700-0400 AppName[3914:2044352] ERROR: Method 'onError:' not defined in Plugin 'WebAppLocalServer'
2019-04-02 18:15:21.652768-0400 AppName[3914:2044352] FAILED pluginJSON = ["WebAppLocalServer304030848","WebAppLocalServer","onError",[]]
2019-04-02 18:15:21.667673-0400 AppName[3914:2044352] ERROR: Method 'onNewVersionReady:' not defined in Plugin 'WebAppLocalServer'
2019-04-02 18:15:21.667783-0400 AppName[3914:2044352] FAILED pluginJSON = ["WebAppLocalServer304030849","WebAppLocalServer","onNewVersionReady",[]]
2019-04-02 18:15:22.314741-0400 AppName[3914:2044352] ERROR: Method 'checkForUpdates:' not defined in Plugin 'WebAppLocalServer'
2019-04-02 18:15:22.314793-0400 AppName[3914:2044352] FAILED pluginJSON = ["WebAppLocalServer304030850","WebAppLocalServer","checkForUpdates",[]]
2019-04-02 18:15:40.870345-0400 AppName[3914:2044389] App startup timed out, reverting to last known good version
2019-04-02 18:16:26.735677-0400 AppName[3914:2044352] ERROR: Method 'checkForUpdates:' not defined in Plugin 'WebAppLocalServer'
2019-04-02 18:16:26.735864-0400 AppName[3914:2044352] FAILED pluginJSON = ["WebAppLocalServer304030852","WebAppLocalServer","checkForUpdates",[]]
FYI, Swift >= 4 breaks the hot-reload
We need someone who is adept to Swift to help fix the issue
Hello guys, any update on this? Meteor needs to support Swift 4+ as soon as possible, because now there is also this other issue.
@rj-david @wreiske Is the hot reload the only known issue with @rj-david's fixes? This is definitely a critical issue now.
I might be willing to temporarily do without some functionality related to Meteor's environment rather than uninstalling->installing->uninstalling->installing xcode every time I need to deploy.
I made a new PR: https://github.com/meteor/cordova-plugin-meteor-webapp/pull/78
@benjamn, can you take a look?
@rj-david, @benjamn Thank you for your work on this! I just tried again with Xcode 10.2, Meteor 1.8.1, and webapp 1.7.4 (which uses @rj-david's awesome PR in cordova-plugin-meteor-webapp 1.7.0 under the hood) and everything builds correctly.
I think this issue can also be closed now that webapp 1.7.4 is published, is that correct?
Sorry but does anyone know when webapp 1.7.4 will be published?
@alanning @rj-david @benjamn Does anyone have a recommended course of action?- this does not work for me
@frankwo1 Have you tried this already?
meteor update --release 1.8.1-issue-10516.0
@davidecantini Thanks - no not with that version of Meteor (am using 1.8.1) - I'm going to try it now
@davidecantini Thanks - it seems to work although I think I broke my key chain somewhere since I am getting this error "iPhone has denied the launch request. Internal launch error: process launch failed: failed to get the task for process 371" I will reset the keychain
Xcode 10.2 apparently no longer supports Swift 3.
Reproduction:
Opens Xcode 10.2 and a dialog box appears with the following error message:
Changing the SWIFT_VERSION to 4.0 and attempting to build produces the following errors: