-
Notifications
You must be signed in to change notification settings - Fork 110
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
App Store: invalid swift support #4
Comments
Hello :) I'm not an expert of ionic, but I guess it uses xcode to build your app and maybe you don't have the last version of xcode. Did you try to update it recently ? What version do you have ? |
Hey there, Well it's a bit more complicated than that. Ionic is providing a cloud build service. Not sure which version they are using. But when I generate an Xcode project for local builds, Xcode complains about the Swift Syntax the plugin is using (old syntax version) and doesn't build at all. (ed: the syntax of the plugin needing swift support, not yours) I'm trying to include this plugin: https://github.com/becvert/cordova-plugin-zeroconf with Swift support added by yours. Swift - well I can't say I ever really got into it, but so far it JustWorked(tm). Everything except submitting to the app store. It's always the details. :) |
Hmmm, and when you say it worked, it doesn't work since when ? |
Ok everything works except submitting, I didn't read well. And even if you get errors from xcode for your local build you managed to deploy on a device ? Or is it just warnings ? |
That's the thing: It's the first time I tried to submit this app to the App Store. While the plugin does what it is supposed to do, submitting fails. It never stopped working functionally. Hard to pinpoint any particular reason other than the message I get from Apple.
|
Weird ... Could you check if the EMBEDDED_CONTENT_CONTAINS_SWIFT flag is well configured to YES ? |
I never built it locally prior to when I got the error from Apple. That's when I tried local builds and got a build error. Now my guess is that ionic uses an old Xcode version. That's why it builds but apple complains about versions. I posted an issue over there as well. But I can't figure out what the swift syntax error is that Xcode complains about. Don't know enough about swift and Xcode. Looks like an issue to drop over at the zeroconf plugin. It probably has nothing to do with your plugin. :)
|
I have to contact the ionic people. I can't access the full build log, only when it fails. The build doesn't fail however... Could be that their build processor handles some things different than Cordova does locally.
|
I don't think so. I think this is just a wrapper of Cordova commands for this part. I will try later to test this plugin and check if I find something. What version of ionic are you using ? |
I use Ionic current CLI. Here's the first few outputs of a local build using cordova build:
Should EMBEDDED_CONTENT_CONTAINS_SWIFT be part of this settings list?
|
When I look at the xcode project file after running "cordova build ios --device --release", I see that the settings haven't been picked up correctly:
Bridging header seems to be correct, tho. |
Yep it should be configured to YES, looks like you pointed the issue. |
I finally managed to build an IPA that is accepted by the App Store and was able to distribute it using Test Flight. Now the app crashes 500ms after loading, not reproduceable on the simulators, nor with the debug profiles. No crash logs. Once I remove everything Swift related, the App works with binaries signed for distribution even on Test Flight. Not sure where to go from here other than to skip Swift alltogether for now. It seems to be a classy YMMV. |
Wow, so it crashes only from TestFlight ?? |
Just chiming in, what seems to be the issue? |
I need to tackle this in a reproduceable way since the problem literally could be anything. Yes, in fact debug release (debug key, provisioning) always work. Here's what I observed:
So there's many different factors and it's hard to pinpoint anything specific. Which leads me to believe that this might have also something to do with code signing or the deployment target version. if I remember correctly, there's a difference in the way that a distribution release has to bundle and sign binaries depending on the deployment target of 8.0 vs 9.0. |
Sorry, should not be closed. 2 buttons: 50:50 chance of FAIL. :-P |
Reopening |
The method you use to add the EMBEDDED_CONTENT_CONTAINS_SWIFT flag should save the flag to build.xcconfig, correct? But the settings never end up there. Not only the changes from within your plugin, but also config.xml changes are not updating this file. For example, when I set the build deployment-target to 9.0 in config.xml and the device-family to handset and run "cordova prepare", the build.xcconfig doesn't pick up the new value, neither do build-debug.xcconfig or any of the other .xcconfig files, nor xcodeproj. Deployment target is still 8.0 ("IPHONEOS_DEPLOYMENT_TARGET = 8.0") and device family is still both handset and tablet ("TARGETED_DEVICE_FAMILY = 1,2"). So basically, every build is running with cordova's default settings. |
I opened a ticket over at Cordova about preferences in config.xml not being picked up. Not sure if this is related, tho. |
Ok maybe this plugin is not really applied in your case. You should have some logs after adding your platform :
Could you just test the last version (1.1.0) I published this morning. Now the hook is applied after the project is prepared and not after adding the platform. Maybe it causes some issues in your case. |
Actually, I got a build working just now and was able to deploy it via TestFlight and it doesn't crash. I didn't use cordova-plugin-add-swift-support and I had to use XCode>Product>Archive.
When I use build target 8.0, the app gets accepted but crashes on the device. Only works with 9.0. And 9.0 distribution targets can not be built using "cordova build ios --device --release" since cordova doesn't know about teamID etc which is required for signing those binaries. This puts Cordova + Swift between a rock and a hard place. Also, for some reason a debug build does in fact work when built using cordova, even though the cordova libraries are not bundled when using xcodebuild (which is what cordova uses) inside the IPA. In regards to the config.xml file, I just have these that should make a difference but don't:
But according to the docs, this should work fine. |
Sounds crazy. The deployment target setting specifies the lowest operating system version that your app can run on. So configuring it to 9 you can't launch your app on an ios 8 device anymore. It's too bad. |
Hi Alexis, Here's the ouput I get from a local "cordova build ios --device --release":
As you can see the settings from your plugin have not been applied and cordova doesn't take into account config.xml settings. The resulting IPA file from cordova's build (using CLI build tools from xcode) does not contain the swift libraries. It should be at least 3-4MB bigger. When I run the same build within Xcode GUI ("Archive") and check project settings to include the necessary options, the resulting IPA is larger (including swift libraries) and passes the automated iTunes Connect checks. This seems to be really related to a) cordova hooks not firing and config.xml settings beign ignored anyways, b) xcode build tools not including swift libraries when building from CLI. BTW: cordova adds SWIFT_OBJC_BRIDGING_HEADER by default now in build.xcconfig Can your changes be run pre-build instead of after installing the plugin? Is there such a hook in cordova? ionic platform seems to not run the hooks either due to the way they handle app state / configs. |
Hello @genox, I did some updates around hooks in the last version 1.3.1, could you have a try ? |
I removed the plugins, both cordova-plugin-zeroconf and cordova-plugin-add-swift-support and readded zeroconf which nows links yours as a dependency. Output is:
I only get
When completely resetting the project ("ionic state reset"), which essentially deletes all platforms and plugins and reinstalls based on it's package.json definitions. However, after resetting the project, when I start a CLI build, config options are still missing, even with the output present like above:
However, there are new lines in build.xcconfig:
But they are not being picked up on "cordova build ios --device --release". I suspect that this is a cordova issue. Here's all the bridging header files in the project:
First one includes the plugin's header:
|
Hello. Please allow me to may drop a few words... This plugin writes the config options into if the next lines are missing from the log output of the cli build it does probably not matter:
by the way, when I add these new lines to For me, as far as I can tell, this plugin does its job. The issue is with the CLI and maybe codesigning... |
Unfortunately I'm not able to pinpoint any specifics. All I know is that debug releases work and can be built locally and on build platforms such as ionic. But release builds only work when "archived" via Xcode. Xcode picks up the changes build config either via project file or the .xcconfig (the plugin only writes to xcconfig IIRC), so it's not the plugins fault. I can certainly live with this and I by no means blame this plugin for it but since the whole thing is one huge process involving multiple moving parts, someone with a similar problem evidently will end up here first because the symptom points to it. So we will see, I guess. |
Closing since I think #13 fixes this. |
Hi
Got this message after uploading with application loader:
Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.
I don't know how to fix this error. I'm using ionic package service to manage and build the app. Editing project properties is not possible this way.
Any hints would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: