Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin.iOS - Publishing App - Invalid Swift Support

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:

  1. IPA Packager (also Auto Packager)
  2. 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 enter image description here 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.

like image 329
frmi Avatar asked Oct 29 '17 08:10

frmi


2 Answers

To manually fix this problem per build, you will need to do the following:

  1. Archive your app for Publishing.
  2. When the Archives window pops up, go to it in Finder (right click on it and select "Reveal in Finder").
  3. When Finder appears, we need to access the archive's content (right click and select "Show Package Contents").
  4. Inside of the archive package, create a folder called "SwiftSupport".
  5. 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").
  6. Copy all the swift ".dylib" files inside of the Frameworks directory.
  7. Navigate back to "SwiftSupport" and paste those copied libraries.
  8. Now Launch Xcode and load Organizer (Window -> Organizer).
  9. 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.

like image 111
RTOCD Avatar answered Nov 17 '22 13:11

RTOCD


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.

like image 1
frmi Avatar answered Nov 17 '22 14:11

frmi