iOS Build Environment Help Center

Invalid Swift Support

append delete Neyers

win 10
builder 3.60.2
ios sdk 17

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

the app works fine , but i got this when i wanna upload it ,

Reply RSS

Replies

append delete #1. Pierre-Marie Baty

Hello

Interesting report, I just got another one today for the same problem. Does your app use Swift code ?

append delete #2. Neyers

idk really, i'm using admob for ads , there is nothing special. :(
just normal game, with google ads.

and i have noticed the upload tool , it stuck sometimes , and takes for ever to upload , so i had to exit it . and upload again.

append delete #3. Pierre-Marie Baty

Well, did your project compile files ending in .swift ?

Open the build.log file at the root of your Xcode project to find it out.

If the upload gets stuck, closing it and restarting it is the right thing to do. It happens sometimes when the network is congested.

append delete #4. Neyers

yes i have seen a file end with .swift , just one file.

append delete #5. Neyers

it's Dummy.swift , i have no idea what is it

append delete #6. Neyers

hey again.
i have build an empty project , and got same error.
the problem not from my project, any idea how to fix it?

append delete #7. Pierre-Marie Baty

Maybe yes. Please open the master build script build.cmd in the builder's install directory with a text editor, and look for these lines:

% build.cmd around line 3800
	rem // NOTE: before 20220922, we added just the necessary rpaths. It's much simpler to add the common ones systematically.
	echo /usr/lib/swift>>              "!TARGET_BUILD_DIR!\rpaths.txt"
%

Change them to:

% build.cmd around line 3800 after the changes
	rem // NOTE: before 20220922, we added just the necessary rpaths. It's much simpler to add the common ones systematically.
	findstr ".swift$" "!TARGET_BUILD_DIR!\swift-srclist.txt" > nul && (
		rem // 20231116 - only add this rpath if we actually built Swift code in this target, else App Store Connect will mistakenly believe that the app uses Swift
		rem // without being able to guess the Swift version, and end up claiming that the Payload/SwiftSupport folder doesn't exist with the old Swift dylibs in it.
		echo /usr/lib/swift>>              "!TARGET_BUILD_DIR!\rpaths.txt"
	)
%

Rebuild your app thoroughly (tick the "rebuild once") checkbox, upload it and let me know what Apple says this time.

append delete #8. Neyers

i did it , but still got same error too

append delete #9. Neyers

i have to upload the update of my game fast :((
( it's a necessary update.. is there any work around).

append delete #10. Pierre-Marie Baty

Sorry, I have no workaround at the moment. I'm waiting for other people's feedback to decide what to do.

:: @Pierre-Marie Baty added on 18 Nov ’23 · 18:41

*edit* If you have the possibility to build your app with Xcode, then please do so, upload it to App Store Connect (this is guaranteed to work) and send me the two generated .ipa files (the one created by Xcode and the one created by the builder) so that I can binary compare them. Thank you in advance.

:: @Pierre-Marie Baty added on 18 Nov ’23 · 19:23

*edit 2* I've just had an idea. Allow me the night to try it out, I'll report back.

append delete #11. Neyers

i wish i can, my macbook is old and does not support xcode anymore.
okey bro <3 , i wish u the best.

append delete #12. Pierre-Marie Baty

Okay. The workaround I gave you in post #7 is ineffective in your case because your app, although it does not contain Swift code, did compile an empty Swift file, because that's the way these Xcode projects are made, and that was enough for the build script to believe it needed the /usr/lib/swift search path, which triggers the error (in my opinion).

Instead of adding the /usr/lib/swift search path if there were compiled .swift files (because these files may be empty) it is necessary to add it only if the final binary contains actual references to Swift functions in its symbols table.

So a better workaround that could work would be this instead:

% build.cmd line ~3800
	rem // NOTE: before 20220922, we added just the necessary rpaths. It's much simpler to add the common ones systematically.
	"!TOOLCHAIN_PATH!\nm.exe" -a "!OUTDIR!\!OUTFILE!" 2>&1|findstr "_swift" > nul && (
		rem // 20231116 - only add this rpath if we actually built Swift code in this target, else App Store Connect will mistakenly believe that the app uses Swift
		rem // without being able to guess the Swift version, and end up claiming that the Payload/SwiftSupport folder doesn't exist with the old Swift dylibs in it.
		echo /usr/lib/swift>>              "!TARGET_BUILD_DIR!\rpaths.txt"
	)
%

Unfortunately I don't have the possibility to test this today so please do so if you can and please report whether it works.

append delete #13. Neyers

okey , i did it, and still got same error.

append delete #14. Pierre-Marie Baty

Have you increased the build number ? If you upload your ipa using the same build number than a previous upload, App Store Connect will discard your new upload and reuse the old one. This can be misleading because you receive an email that is not about the file you uploaded but about a previously uploaded one.

append delete #15. Neyers

oh no i have not increase it, i'll try it

append delete #16. Neyers

still the same :(

ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.

Best regards,

The App Store Team

append delete #17. Neyers

i tried to change the sdk too, i used the 17.2 beta but still got same error from apple.

append delete #18. Gamester

I tried also all solutions, but none of them work
Including the one deleting the line

rem // NOTE: before 20220922, we added just the necessary rpaths. It's much simpler to add the common ones systematically.
echo /usr/lib/swift>> "!TARGET_BUILD_DIR!\rpaths.txt"

append delete #19. Pierre-Marie Baty

This error makes no sense. Why on Earth would Apple complain that a SwiftSupport directory is missing if your apps do not use Swift code ?

I've read a lot on this subject and it happens that sometimes this error does not mean what it says. It can be triggered by a stale hidden file at the wrong place (e.g. .DS_Store, thumbs.db, .gitkeep and similar.) But in order to find out what Apple dislikes, it would be necessary to compare an .ipa file created by Xcode and one created by the builder. Can either of you do that and send them to me (preferably, because it'll be signed by you), or send me his Xcode project so that I try to build it myself (less preferable, since I'll use my own signing identity at the risk of causing discrepancies) ?

append delete #20. Neyers

i'll upload a xcode project soon to you.

but as i see her
" https://itecnote.com/tecnote/swift-the-swiftsupport-folder-is-missing-rebuild-your-app-using-the-current-public-gm-version-of-xcode-and-resubmit-it/ "

how we can make it yes? in builder?
maybe it will work.

append delete #21. Neyers

i have changed many things , unity v , sdk v , builder v , nothing work!

here an empty project , i have tried to upload and got same error from Apple!
using builder >> Xcode file with a build : https://file.io/8AbwL6TFB0OA

:: @Neyers added on 21 Nov ’23 · 03:05

new link : https://drive.google.com/file/d/1KaNt7P2Hz2VaULMdCDcUjNTosv5wLx65/view?usp=sharing

n : the bundle identifier is new i didnt use it on apple so u can use it.

append delete #22. Pierre-Marie Baty

Well, I built your test project with Xcode, created an archive of it, exported it for distribution to the App Store (without uploading) and the generated .ipa file does not contain any SwiftSupport directory either.

The zip contents of the .ipa package contains a single Payload directory, in which the app directory "IOS TEST Swift Support.app" is the only subdirectory.

If Xcode does not create this directory, how can the App Store claim it's missing ?

I'll upload it now to my Apple developer account and see what Apple says. Then I'll proceed the same with an .ipa of the same project built by the builder. It'll have to work, or to tell why.

append delete #23. Neyers

Yeah this is weird :(
Did you find something?

append delete #24. Neyers

Did you got same error from apple?

append delete #25. Pierre-Marie Baty

I am still investigating it. Xcode makes it extremely painful and this IDE certainly deserves an award for its particular design. Thank you for your patience.

append delete #26. Pierre-Marie Baty

I think I found the problem.

This project does not use Swift, but it does use il2cpp.

And the version of the Unity editor you use supplies macOS executables for the il2cpp compilation step, and copies them in a subfolder of the Xcode project directory. These macOS executables are supposed to be called by Xcode in a "custom build step" phase to compile the il2cpp static library that your project will use.

The problem is that these macOS executables are provided in two variants (Intel and ARM64, to support all Mac's hardware architectures, Intel and Apple M1/M2) *and* rely on dynamic libraries that are written in Swift.

So, the builder parses the Xcode project directory, discovers these files, identifies them as ARM64 Mach-O libraries, and thinks: this iOS project supplies precompiled ARM64 binaries, I should take note of those and include them in the final application. And so it does.

Consequently your final .ipa gets extra files embedded in it, which are useless from the iOS app's point of view because they aren't iOS libraries but *macOS* libraries, that doesn't prevent the app to run (these extra files are simply ignored), but when Apple receives them on App Store Connect for analysis, they do the same mistake as me: they believe these libraries are useful for the app (for what else could they be here?), identify them as Swift libraries, deduce that the app uses Swift code, check whether the SwiftSupport directory is present... and fail.

The "quick and dirty" solution, in your case, is to use a pre-packaging script that contains these lines (WARNING: THIS HACK IS ONLY VALID IF YOUR APP DOES NOT EMBED ANY DYNAMIC LIBRARY):

% prepkg.bat
rem // delete the extra il2cpp host compiler libraries that were mistakenly bundled in the app by the build script
del /f /q "%TARGET_BUILD_DIR%\%NAME%.app\Frameworks\lib*.dylib"
%

Now, if you rebuild your app, you should notice that the .ipa size is smaller as it doesn't contain those extra files, and there are chances that, if you bump the build number as well, Apple will accept your build on App Store Connect. Let me know please.

Meanwhile I'll be looking for a more "proper" way of fixing this.

append delete #27. Neyers

thanks , but what is pre-packaging script?

i created a prepkg.bat

%

@echo off

rem // delete the extra il2cpp host compiler libraries that were mistakenly bundled in the app by the build script
del /f /q "%TARGET_BUILD_DIR%\%NAME%.app\Frameworks\lib*.dylib"
%

is that currecet? , but how i call it or when? i have no idea
i have read about it here : file:///C:/iOS/builder/readme.html#prepkgscript
but still idk where to put it , in builder folder? or xcode project folder.

sorry :(

append delete #28. Pierre-Marie Baty

You can put it anywhere. Simply load it in the builder UI so that it is called during the build process.

append delete #29. Neyers

alright thank you so much , it's works now <3

append delete #30. Pierre-Marie Baty

Very glad to hear that !

A more proper fix will be in the next update.

Reply

(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Moderators: Pierre-Marie Baty