SDL2_image 2.0.5 error with Apple Store/webp

Hello there,

I am experiencing some problems upgrading SDL2_image.Framework to the last version (2.0.5) when uploading it to Apple Store.

As the Framework includes webp as a subFramework, it is complaining about it. I did remove the webp folder from SDL2_image.Framework/Versions/A/Frameworks. But I still got the following error:

Guideline 2.5.1 - Performance

Your app links against the following non-public framework(s):

• Contents/Frameworks/SDL2_image.framework/Versions/A/SDL2_image/_WebPGetFeaturesInternal
• Contents/Frameworks/SDL2_image.framework/Versions/A/SDL2_image/_WebPDecodeRGBInto
• Contents/Frameworks/SDL2_image.framework/Versions/A/SDL2_image/_WebPDecodeRGBAInto

Next Steps

The use of non-public APIs is not permitted on the App Store as it can lead to a poor user experience should these APIs change.

So the APIs are still found on the SDL2_image Unix executable, and therefore, the app is rejected by Apple Store.

Did any one else experience the same problems?

Many thanks.

A couple months ago I recompiled SDL2_image for Apple Silicon and when I did I was able to exclude the WebP parts all together. In fact I think I only included PNG because that’s all I’m using. I think I may have had to compile LibPNG myself. I think there was a configuration option for this (what to include). You may end up needing to compile yourself too.

What I can’t tell from your error message is whether it rejected it because it detected the WebP library was calling non-public APIs or because it mis-flagged the WebP library in your app as a non-public API (obviously it’s non-public, but it’s in your app, so why should it matter). Not that it matters. You just need it gone. Recompiling yourself is probably your quickest option. It took me about an hour to make the changes necessary.

Another possible approach would be to use SDL_stbimage rather than SDL2_image. It’s a lightweight header-only library, with no external dependencies, but still loads the common image formats (PNG, GIF, JPG, BMP etc.).

1 Like

Thanks to both of you,

Your approaches sound very promising. @rtrussell yours would be probably the easiest one, but looks like I should change most of the code to include the STB prefix, which would become a big problem, as most of it is shared code with other apps we have.

That being said, I added Xcode SDL2_image project to my main project, and funny enough, I get those errors:

Ld /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Products/Debug/ normal (in target 'vManager' from project 'manager-osx')
    cd /Volumes/external/development/manager/manager-osx
    /Applications/ -target x86_64-apple-macos10.9 -isysroot /Applications/ -L/Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Products/Debug -F/Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Products/Debug -F../../libs/sdl2/osx -F../../libs/sdl2/osx/sandbox -filelist /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Intermediates.noindex/ -Xlinker -rpath -Xlinker @executable_path/../Frameworks -Xlinker -rpath -Xlinker ../../libs/sdl2 -Xlinker -object_path_lto -Xlinker /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Intermediates.noindex/ -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -fobjc-arc -all_load /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Products/Debug/libSDL2_image.a -framework AppKit -lcurl.4 -framework SDL2_ttf -framework SDL2_net -framework SDL2_ttf -framework SDL2_mixer -framework SDL2 -lz -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Intermediates.noindex/ -o /Users/michaelchiou/Library/Developer/Xcode/DerivedData/manager-osx-bjfqiocpavwcxvfuxupafsuuihvp/Build/Products/Debug/

Undefined symbols for architecture x86_64:
  "_WebPDecodeRGBAInto", referenced from:
      _IMG_InitWEBP in libSDL2_image.a(IMG_webp.o)
  "_WebPDecodeRGBInto", referenced from:
      _IMG_InitWEBP in libSDL2_image.a(IMG_webp.o)
  "_WebPGetFeaturesInternal", referenced from:
      _IMG_InitWEBP in libSDL2_image.a(IMG_webp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sounds very promising so far, I tried to delete all references to webp, but couldn’t
make it compile successfully yet. I will keep working on it, it looks like it is the correct way to face the issue.

1 Like

Just in case someone else is facing that issue, forgot to confirm that fixed it! Once again, many thanks to all the help.