Xamarin.iOS - Publishing App - Invalid Swift Support - ios

I've been struggling publishing my iOS app for review with the following error:
Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.
I'm using Xamarin.iOS to develop this app, and i receive the above error if i use Visual Studio to Sign and Export the IPA or if i use Xcode to publish.
Tool versions:
Xcode 9.0.1
Visual Studio Enterprise 2017 for Mac 7.2
Xamarin.iOS 11.2.0.11
I have tried the following suggestions:
IPA Packager (also Auto Packager)
Manual packaging using this guide
The second suggestion didn't give a different response.
Using the IPA Packager gave the following response from iTunes Store:
Invalid Swift Support - The files libswiftAVFoundation.dylib, libswiftDarwin.dylib, libswiftQuartzCore.dylib, libswiftFoundation.dylib, libswiftCoreAudio.dylib, libswiftCoreGraphics.dylib, libswiftCoreLocation.dylib, libswiftCore.dylib, libswiftCoreImage.dylib, libswiftDispatch.dylib, libswiftPhotos.dylib, libswiftObjectiveC.dylib, libswiftCoreMedia.dylib, libswiftUIKit.dylib don’t match /Payload/App.iOS.app/Frameworks/libswiftAVFoundation.dylib, /Payload/App.iOS.app/Frameworks/libswiftDarwin.dylib, /Payload/App.iOS.app/Frameworks/libswiftQuartzCore.dylib, /Payload/App.iOS.app/Frameworks/libswiftFoundation.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreAudio.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreGraphics.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreLocation.dylib, /Payload/App.iOS.app/Frameworks/libswiftCore.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreImage.dylib, /Payload/App.iOS.app/Frameworks/libswiftDispatch.dylib, /Payload/App.iOS.app/Frameworks/libswiftPhotos.dylib, /Payload/App.iOS.app/Frameworks/libswiftObjectiveC.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreMedia.dylib, /Payload/App.iOS.app/Frameworks/libswiftUIKit.dylib. Make sure the files are correct, rebuild your app, and resubmit it. Don’t apply post-processing to /Payload/App.iOS.app/Frameworks/libswiftAVFoundation.dylib, /Payload/App.iOS.app/Frameworks/libswiftDarwin.dylib, /Payload/App.iOS.app/Frameworks/libswiftQuartzCore.dylib, /Payload/App.iOS.app/Frameworks/libswiftFoundation.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreAudio.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreGraphics.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreLocation.dylib, /Payload/App.iOS.app/Frameworks/libswiftCore.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreImage.dylib, /Payload/App.iOS.app/Frameworks/libswiftDispatch.dylib, /Payload/App.iOS.app/Frameworks/libswiftPhotos.dylib, /Payload/App.iOS.app/Frameworks/libswiftObjectiveC.dylib, /Payload/App.iOS.app/Frameworks/libswiftCoreMedia.dylib, /Payload/App.iOS.app/Frameworks/libswiftUIKit.dylib.
I have also tried publishing the app without stripping Swift symbols, when publishing from Xcode
This gave yet another result:
This bundle is invalid - Your archive contains paths that are not allowed: ( "AppThinning.plist" )
I'm out of ideas how to solve this. It's a strange feeling being so close to publish the app, and then struggling with this in the last step of the process.

To manually fix this problem per build, you will need to do the following:
Archive your app for Publishing.
When the Archives window pops up, go to it in Finder (right click on it and select "Reveal in Finder").
When Finder appears, we need to access the archive's content (right click and select "Show Package Contents").
Inside of the archive package, create a folder called "SwiftSupport".
Inside of the package navigate to "Product/Applications/YourAppName.app/Frameworks" (You will need to right click on the .app and select "Show Package Contents").
Copy all the swift ".dylib" files inside of the Frameworks directory.
Navigate back to "SwiftSupport" and paste those copied libraries.
Now Launch Xcode and load Organizer (Window -> Organizer).
Find your app in the Archives and "Upload to App Store...".
I was only able to get this to work using Xcode Organizer, using Xamarin always failed.
Note: I am using Visual Studio for Mac Community 7.3.2 (build 12).
This is copied from my answer found here.

Okay, so i solved my issue. It turns out that Xamarin doesn't yet provide support for Swift bindings.
A library i was using (Xamarin.iOS.CameraViewController) was using Swift bindings, using Xamarin.Swift3.Support. However, this version does not work with Xcode 9.0.1 as Xcode changes structure for the Swift libraries for each version according to the author of Xamarin.Swift3.Support.
I removed Xamarin.iOS.CameraViewController and all Xamarin.Swift3 references and the app completed processing.

Related

Error on publish app to AppStore Xamarin.iOS build

Issue: Invalid Swift Support- The file libswiftAVFoundation.dylib doesn’t
I have tried to resolve my issue based on the following link. but still, I'm getting the issue after uploaded in App store. Please help me resolve this issue. I'm new for Xamarin.iOS
https://docs.google.com/document/d/1nWY-RK9oXsNnlca5eSvbH9tQejLnCjismHrSy8IuDFo/edit
Totally I have created two projects in Xamarin and works well in locally.
Project 1. Xamarin Sample Binding Project
- Here, I have included my own Swift SDK
Project 2. Xamarin Sample Demo Project
- Mapped the Binding project
Generated the iPA file:-
Created the IPA file for Project 2 in Xamarin. The IPA doesn't have the SwiftSupport folder. Then I have followed the above doc steps and export the IPA file using Xcode. I have extracted the IPA file and seen swiftSupport folder. After, I have submitted in the Appstore I'm getting the below issue.
AppStore Failed error message:-
Invalid Swift Support- The file libswiftAVFoundation.dylib doesn’t
have the correct code signature. Make sure you’re using the correct
signature, rebuild your app using the current public (GM) version of
Xcode, and resubmit it. Don’t just modify the code signature of
libswiftAVFoundation.dylib.
Finally, Luckily my app works fine. I have just removed all swift framework lib and added the Xamarin.Swift lib only from the Package. That's it.
Thank you Every one

Xcode 9.2 Upload to App Store fails with description length and invalid toolchain errors

I've read through a bunch of forums including here:
https://forums.developer.apple.com/thread/87862
and some Stack Overflow posts.
I have tried modifying my plist using the proposed solution of
find Products/ -name Info.plist -print0 | xargs -0n1 plutil -replace BuildMachineOSBuild -string 16A323
in the archive directory that I'm trying to load, and I'm still receiving the error below. I believe I have valid Xcode and Mac OS versions. I'm running Xcode 9.2 which was released today and High Sierra 10.13.1. Why does my upload fail with these errors and how can I fix it?
The errors in text (to make this post more searchable):
The following issues occurred while distributing your application.
⚠ iTunes Store Operation Failed
description length:2651858
⚠ iTunes Store Operation Failed
ERROR ITMS-90534: "Invalid Toolchain. New apps and app updates must be built with the public (GM) versions of Xcode 6 or later, macOS, and iOS SDK or later. Don't submit apps built with beta software including beta macOS builds."
Right-Click on the archive file (.xcarchive) > Show Package Contents > Products > Applications > Right-Click on the app file > Show Package Contents > Double-Click on Info.plist to edit it
Change value of DTXcodeBuild from 9C40b to 9C40
Re-submit and it will work
Edit/Disclaimer: this is just a trick to bypass the upload process, iTunesConnect still doesn't allow submission with 11.2 so this is not the right solution.
I started with several "iTunes store operation failures". While fixing the other errors, I keep trying to fix this "description length" error too - but it always failed.
So I solved all other errors first and suddenly this error was gone too.
I BELIEVE this error depends on other errors. The last error I fixed was called "Storyboard file not found")
Xcode 9.2
UPDATE:
Although my option may let you upload the package to iTunesConnect successfully, but may fail when you click Submit for Review.
Check this screenshot
Right-Click on the archive file (.xcarchive) > Show Package Contents > Products > Applications > Right-Click on the app file > Show Package Contents > Double-Click on Info.plist to edit it
Change DTXcodeBuild's value from 9C40b to 9C40 and it will work.
There is a discussion on this subject : https://forums.developer.apple.com/thread/93253
They advise to wait for the deployment of the new Xcode version number on the backend or come back to Xcode 9.1, it seems it works.
UPDATE : Change the DTXcodeBuild doesn't work
Hard Clean Product worked for me.
Hard clean the product by Command + Shift + Alt + K, then upload a new build to AppStore.
I hope this will work for you too.
Already Fixed, just try again to submit the app.
This issue was solved for me with installing the latest stable release of Xcode 9.2 (mac OSX Sierra 10.12.6)
I found a workaround it:
Download Xocde 9.1 from https://developer.apple.com/download/more/
Make a fresh archive then upload it. It worked for me.
P.S. I did not send for review but I sent it to internal testers including myself.

Invalid Swift Support - Files not in right location

I've been trying to upload a new build to iTunes Connect to update an app. I first used xCode 6 but got a email from Apple stating this:
Dear Developer,
We have discovered one or more issues with your recent delivery for "App". To process your delivery, the following issues must be corrected:
Invalid Swift Support - The files libswiftDarwin.dylib, libswiftDispatch.dylib, libswiftCoreGraphics.dylib, libswiftUIKit.dylib, libswiftContacts.dylib, libswiftCore.dylib, libswiftCoreAudio.dylib, libswiftFoundation.dylib, libswiftXCTest.dylib, libswiftCoreImage.dylib, libswiftObjectiveC.dylib aren’t at the expected location /Payload/App.app/Frameworks.
Move the file to the expected location, rebuild your app using the current public (GM) version of Xcode, and resubmit it.
Once these issues have been corrected, you can then redeliver the corrected binary.
I thought it was a simple fix, so I just updated to the latest GM (Xcode 7.2) & completed the Swift 2 migration, however I received the same email. Could someone explain how to solve this and what those files are? This isn't a "files don't match" problem as seen in other questions.
I stumbled upon this as I've encountered the same problem. It's the first time I've been tasked with handling the release of a Swift app to the App Store.
I found that this answer by TALAA works a treat: https://stackoverflow.com/a/26949219/1567836
There is an "Embedded Content Contains Swift Code" flag in the Build Settings that needs to be set to YES. After setting this, clean the project before building again.
After the clean, you'll have to recreate a build to upload to the App Store. You might find that the new upload will get rejected claiming that a binary already exists for that number. If you update the build number (has to be larger than the previous one) then the new upload will be accepted.
As per the #Thomas You need to enable that flag and after that for the "Invalid Swift Support", I had the issues with Application Loader since Xcode 6.4. So, I started uploading the app from the "Organizer" (Xcode > Window > Organizer > Upload to App Store).
This solves the problem.
Inspect the payload and also the SwiftSupport folder in the .ipa file (by converting it to a .zip) and make sure the libraries in the email match across both those directories. Those need to match apparently.
You should probably not have libswiftXCTest.dylib in the Payload/App.app/Frameworks or SwiftSupport folders in something you're submitting to Apple. If you do, check the build section of the scheme for your App target and make sure you aren't including any test targets in your Archive step.

xcode sumbission the application you have selected does not exist

Has anyone seen such an error ? What does it mean ?
It was an update of already existed app.
Xcode automatically manage provisioning profiles.
Xcode 6.3.2
OS X Yosemite 10.10.3
try to use Application Loader (https://itunesconnect.apple.com/apploader/ApplicationLoader_3.0.dmg)
Had the same problem with Xcode 6.4, but went thru using Application Loader
Or you can open it from Xcode -> Open Developer Tools -> Application Loader
I finally got my binary uploaded to iTunesConnect.
Archive your app in Xcode as normal. (I'm still using 6.2)
In Organizer, select the archive, Export, select Ad Hoc or App Store. This saves an .ipa file.
Open AppLoader, select "Deliver Your App", click "Choose", select the .ipa file from step 2. Follow the prompts.
Notes
Going this route, you won't need to recreate the In-App-Purchase that AppLoader expects when you start from scratch.
I got a warning that the API analysis file being too large, but I think that can be safely ignored.
The uploaded binary has a warning that the entitlement for TestFlight Beta testing is missing, but I don't use that, and it can also be ignored.
If you have xcode < 7.x then you are going to face this problem..What fixed for me was building the project from xcode 6.x(mine 6.4) and then opening xcode > 7.x (mine 7.0) and then uploading app from there...
Note:You dont need to build app from xcode 7.x . Just open the xcode
and select window organizer...select the build and upload...
In my case firstly I installed last Xcode version 7.1
In my application I used GoogleMaps.framework, I opened it's bundle and removed "Executable file" and "CFSupportedPlatforms" from Info.plist, then I did the same to all my added frameworks
Finally fixed this problem, first you need to upload it with Application loader. Cause when the error happen, you can have more detail about it.
This is the Issues I got, and I found that the version numbers are the same as those library in cocoapod or other library. To solve this. Go thought all the info.plist. And change the Bundle versions string, short, and Bundle version to higher value, in my cause version number > 1.3.5.
hope this can help :D
Im stuck with the same issued, solved by download xcode 7 and submit app with it, error gone!. Hope it help everyone!.
I was using atool from a shell script to verify and upload builds to TestFlight, then I found this thread and decided to follow #bwang's advice to use the Application Loader, and it worked!
I didn't have to download ApplicationLoader because it already comes bundled with Xcode 6.4, I just opened Xcode, then from the Dock I right clicked the Xcode icon, and then I selected "Open Developer Tools > Application Loader".
I hope Apple fixes this issue soon, because its breaking many CI tools like jenkins when using it to upload builds using atool.
Encountered the same issue, tried all the options mentioned but no luck, Finally could solve the issue by modifying 3rd parties info.plist
Search all info.plist files in your project and see where each and every plist has "Bundle Identifier". If not add it and submit via application loader.
When Xcode submission isn't working, upload using Application Loader instead:
Archive from Xcode.
Save the resulting .IPA file.
Upload with Application Loader.
That solves this issue and many other times when Xcode upload isn't working. Additionally, if it still fails, it will often give you a more detailed error message output.

Using embedded framework in Xcode 6.1 results in app crashing with mapped file has no team identifier

We created a framework that we use for our iOS projects. In the general tab you can see it as an embedded binary.
In the build phases tab it shows up as an embedded framework:
After archiving the project and installing the ipa file on a device and then launching the app I see the following error in the device console:
[deny-mmap] mapped file has no team identifier and is not a platform binary: /private/var/mobile/Containers/Bundle/Application/CE2542E1-355A-4A45-AC97-08A2330B45E5/Policy Pal.app/Frameworks/MTKit.framework/MTKit
Please help! I haven't seen anybody come across this problem before.
We are seeing this too. According to this blog you need to revoke and re-generate your certificate and mobile provisioning file. We haven't tried it yet, but the symptoms are the same.
EDIT: Our build-meister did this a few weeks ago and it does indeed fix the problem.

Resources