SDL on Mac appstore (64bit only) errors

I’m trying to release a port of an old game of mine to the Mac. I got everything working, but when I submit to the Appstore I get a lot of errors. Most has to do with the fact that Apple doesn’t allow 32bit binaries anymore (The word is that the OS itself will stop accepting 32 bit as off the next release).
The SDL2 and SDL2_Mixer are still built with both 32bit and 64bit in them.
Also a lot of errors about bundle identifiers in the SDL and Mixer frameworks.

Anyone any idea how to fix this??

Thanks a lot!

Reinier

The errors I got are:

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2.framework/Versions/A/SDL2)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/Versions/A/FLAC)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework/Versions/A/modplug)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework/Versions/A/mpg123)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework/Versions/A/Ogg)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Unsupported Architectures. Your executable contained the following disallowed architectures: ‘[i386 (in nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework/Versions/A/Vorbis)]’. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018.

An unknown error occurred.

Missing Bundle Identifier. The application bundle contains a tool or framework FLAC [nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework] that is missing the bundle identifier in its Info.plist file.

An unknown error occurred.

Missing Bundle Identifier. The application bundle contains a tool or framework modplug [nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework] that is missing the bundle identifier in its Info.plist file.

An unknown error occurred.

Missing Bundle Identifier. The application bundle contains a tool or framework mpg123 [nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework] that is missing the bundle identifier in its Info.plist file.

An unknown error occurred.

Invalid Code Signature Identifier. The identifier “FLAC” in your code signature for “FLAC” must match its Bundle Identifier “$bundleIdentifier”

An unknown error occurred.

Invalid Code Signature Identifier. The identifier “modplug” in your code signature for “modplug” must match its Bundle Identifier “$bundleIdentifier”

An unknown error occurred.

Invalid Code Signature Identifier. The identifier “mpg123” in your code signature for “mpg123” must match its Bundle Identifier “$bundleIdentifier”

An unknown error occurred.

While I have no business helping with Apple products since I don’t have any at this time; I do know that most compilers won’t always choose the right library when linking to them. You’ll probably need to link directly to the SDL2 and SDL2_Mixer 64 bit libraries.

Hi Blerg. Thanks for the help.
Unfortunately the Libraries on the Mac are mixed frameworks. They contain both the 32 bit as the 64 bit binaries. Strangely enough the compiler won’t help when you select you want to build a 64bit app. It will only compile your part of the app into 64 bit, but the frameworks are included as is, and will still contain the 32 bit code.
I think I need 64 bit builds of the frameworks, or perhaps there is a hidden setting I can use. I’m hoping someone else has bumped into this and has a solution

You can use the lipo tool to remove architectures from your frameworks. For instance, something like this might work or get your closer:
lipo -remove i386 SDL2.framework

Is usage of “lipo” command recommended by Apple?
Okay, so then as far as I can tell, you can bundle frameworks together on Apple platforms. Good to know, I guess. . . .

That’s probably the case. Check the architectures and see if you have a 64 bit version.

Cool. The exact command turned out to be: lipo -remove i386 SDL2.framework/SDL -o SDL2.framework/SDL

But the for SDL2Mixer a lof more needed to happen since it in turn contains fat frameworks.
So for every embedded framework in SDL_Mixer you need to do the above.
But… thats not al. The embedded frameworks have the framework twice, so you need to do it twice. Since there are 5 embedded frameworks, thats quite some typing. To lipo FLAC in the mixer you need to type:
lipo -remove i386 SDL2_mixer.framework/Frameworks/FLAC.framework/FLAC -o SDL2_mixer.framework/Frameworks/FLAC.framework/FLAC
But then also:
lipo -remove i386 SDL2_mixer.framework/Frameworks/FLAC.framework/Versions/A/FLAC -o SDL2_mixer.framework/Frameworks/FLAC.framework/Versions/A/FLAC

in any case, this removed half my errors. I’ll try and see if the others can be fixed in similar ways. If I succeed (or not ) I’ll post here. Thanks for the pointers so far

Geez, I’ll take a single file with just one thing in it over what you’re going through.

Ok… Finally got it in the appstore. There are some additional steps you have to take:

First you need to speicify the key under which you want to be listed in your Info.plist:
LSApplicationCategoryType
public.app-category.action-games

Further some of the embedded frameworks in SDL2_Mixer have no bundle identifier. So you need to go in and specify them, but also be very specific about them:
for instance the bundleidentifier for modplug needs to be called ‘modplug’, the one for ‘mpg123’ needs to be called ‘mpg123’ and FLAC needs to be called ‘FLAC’. (So thats in their respective Resource/Info.plists (under the Key: CFBundleIdentifier. ))

So that solved it for me… thankfully I can store these frameworks away and use them for next time.
However, maybe someone can inform the developers/maintainers to make these changes themselves so we don’t have to do surgery on the files.

thanks for the help

Ah…Partied too soon. Just tried to make a development build, and now the music has stopped working. So I think I have botched the mpg123.framework. It doesn’t crash, but just doesn’t play anything anymore. Great.
Anyhow, If i resolve it I’ll share the magic formula to make it both appstore ready, and actually working

So turns out 3 of the embedded frameworks in SDL2_mixer are signed. So when you edit the plist, they don’t work anymore.
If anyone has ideas… I found the original mpg123 repo, but compiling it seems like a crazy big task. I also tried to remove the signing of mpg123 and that corrupted the framework so it wouldn’t link anymore.
If anyone has ideas… :disappointed:

If you don’t want to release your source, change libraries. From what I can tell, Apple makes you statically link your app to all of the libraries it uses, so if you use mpg123, you’re going to have to change your license to LGPL since you must statically link the app.

Can you sign the apps yourself for test builds?

I just got an email from the appstore, with a new list if 40 things wrong with the SDL frameworks.
I think I officially just quit trying to submit my app to the store. I think I’ve had enough. I’ll just release my stuff from a self hosted download location and call it a day.
Even though SDL gave me a small boost in productivity. I think I should have gone about it without using it just like I did with my iOS port. Just write my own PixelBuffer wrapper, and use CoreAudio to play the darn MP3’s.
Maybe I’ll try that next.
Thanks for the help, and the next person to attempt this hopefully can get some info and help from this post.

Could you post those? I’m pretty sure at least one of the devs would want to take a look at them so that they can get them fixed. There might just be one or more things wrong with your setup and it’ll be smooth sailing once they’re fixed. I used to always have that problem when I first started setting up SDL with my apps, linking was always a pain.

sure. (btw every http:// I replaced with zzz:// because I couldn’t post links on this forum ;^)


We identified one or more issues with a recent delivery for your app, “Moon Child”. Please correct the following issues, then upload again.
Invalid Signature - The nested app bundle SDL2_mixer at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework has following signing error(s): --prepared:/Volumes/data01/app_data/dstr/mz_6992986583370845247dir/mz_1947279542546767103dir/nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/Versions/Current/. /Volumes/data01/app_data/dstr/mz_6992986583370845247dir/mz_1947279542546767103dir/nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A: bundle format is ambiguous (could be app or framework) In subcomponent: /Volumes/data01/app_data/dstr/mz_6992986583370845247dir/mz_1947279542546767103dir/nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Invalid Signature - The executable at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/FLAC has following signing error(s): bundle format is ambiguous (could be app or framework) . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Invalid Signature - The executable at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework/Ogg has following signing error(s): bundle format is ambiguous (could be app or framework) . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Invalid Signature - The executable at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework/Vorbis has following signing error(s): bundle format is ambiguous (could be app or framework) . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Invalid Signature - The executable at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework/modplug has following signing error(s): bundle format is ambiguous (could be app or framework) . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Invalid Signature - The executable at path MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework/mpg123 has following signing error(s): bundle format is ambiguous (could be app or framework) . Refer to the Code Signing and Application Sandboxing Guide at zzzz://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at zzzzs://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
Unable to Sign - This package doesn’t meet the current code signing requirements. For more information, see the Code Signing and Application Sandboxing Guide and Technical Note 2206.
Specifically, codesign generated the following error:

nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework/FLAC: bundle format is ambiguous (could be app or framework)


nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework/Ogg: bundle format is ambiguous (could be app or framework)


nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework/Vorbis: bundle format is ambiguous (could be app or framework)


nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework/modplug: bundle format is ambiguous (could be app or framework)


nl.proofofconcept.mac.moonchild.pkg/Payload/MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework/mpg123: bundle format is ambiguous (could be app or framework)

Malformed Framework - The framework bundle FLAC (MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/FLAC.framework) must contain a symbolic link ‘FLAC’ -> ‘Versions/Current/FLAC’. Refer to the Anatomy of Framework Bundles for more information.
Malformed Framework - The framework bundle (MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Ogg.framework) must contain a symbolic link ‘Ogg’ -> ‘Versions/Current/Ogg’. Refer to the Anatomy of Framework Bundles for more information.
Malformed Framework - The framework bundle (MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/Vorbis.framework) must contain a symbolic link ‘Vorbis’ -> ‘Versions/Current/Vorbis’. Refer to the Anatomy of Framework Bundles for more information.
Malformed Framework - The framework bundle modplug (MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/modplug.framework) must contain a symbolic link ‘modplug’ -> ‘Versions/Current/modplug’. Refer to the Anatomy of Framework Bundles for more information.
Malformed Framework - The framework bundle mpg123 (MoonChild.app/Contents/Frameworks/SDL2_mixer.framework/Versions/A/Frameworks/mpg123.framework) must contain a symbolic link ‘mpg123’ -> ‘Versions/Current/mpg123’. Refer to the Anatomy of Framework Bundles for more information.

Hmmm, just guessing, but I think it didn’t like you removing those frameworks earlier. Did you follow a tutorial, or instruction guide on how to add the frameworks to your app?

I had to ‘fix them’ according to the rules apple has with respect to frameworks. But probably my ‘fixing’ them, broke something else.
But since I’m in completely uncharted territory and the stuff online is obscure (on iOS there’s soooo much more stuff to find) I think it’s wasteful of continuing on this line.

I think what I’ll try is to remove all ambedded frameworks from the SDLMixer, and try to use coreaudio for mp3 playback (I use AVFoundation for video playback anyway as well). That way all problematic frameworks are gone and I have a better hope of getting through.

I’ll report back ;^)

Good luck to you. I’m not looking forward to any of that non-sense when I start on Apple.

Yes… I found the magic formula:

Open SDL2_Mixer and throw out all ogvobis, modplug,mp3, flac and other frameworks. So Just keep the mixer for mixing sound effects. For MP3 Playback just use NSSound which is ridiculously easy and supports MP3 and some other formats. Since now the offending frameworks are not there anymore, it went through without a hitch!

So remember, you still need to lipo the fat binaries, other than that it’s probably off to the track (Except when you really need those embedded music players)

By the way, for decoding there is also SDL_sound: https://www.icculus.org/SDL_sound/
The latest hg code has massive changes that threw out all LGPL libs (the linked homepage doesn’t reflect that yet) and uses bundled libs instead (mostly public domain single-header libs).
icculus wrote about this at https://www.patreon.com/posts/project-sdl-2-0-20211701