kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
776 stars 240 forks source link

Error compiling SDL_Image #763

Closed HeaTTheatR closed 1 year ago

HeaTTheatR commented 1 year ago

When compiling Kivy, an error occurs with the compilation of the SDI_Image package:

error: ApplicationServices is not available when building for iOS Simulator. (in target 'Static Library' from project 'SDL_image')

Kivy-iOS Installation Method:

python3 -m venv venv
. venv/bin/activate
pip3 install kivy-ios
xcode-select --install
brew install autoconf automake libtool pkg-config
brew link libtool
toolchain build python3 kivy

Error log:

[DEBUG   ] x SDL2_image-2.6.2/Xcode/jxl/jxl.xcodeproj/
[DEBUG   ] x SDL2_image-2.6.2/Xcode/jxl/jxl.xcodeproj/project.pbxproj
[DEBUG   ] x SDL2_image-2.6.2/Xcode/jxl/jxl/jxl_export.h
[INFO    ] Prebuild sdl2_image for x86_64
[INFO    ] Apply patch fix-ios-xcodebuild.patch
[INFO    ] Build sdl2_image for x86_64
[INFO    ] Running Shell: /usr/bin/xcodebuild ('IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4', 'ONLY_ACTIVE_ARCH=NO', 'ARCHS=x86_64', 'BITCODE_GENERATION_MODE=bitcode', 'HEADER_SEARCH_PATHS=/Users/Anton/KivyIOS/kivy-ios/dist/include/common/sdl2', '-sdk', 'iphonesimulator', '-project', 'Xcode/SDL_image.xcodeproj', '-target', 'Static Library', '-configuration', 'Release') {'_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] Command line invocation:
[DEBUG   ]     /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild IDEBuildOperationMaxNumberOfConcurrentCompileTasks=4 ONLY_ACTIVE_ARCH=NO ARCHS=x86_64 BITCODE_GENERATION_MODE=bitcode HEADER_SEARCH_PATHS=/Users/Anton/KivyIOS/kivy-ios/dist/include/common/sdl2 -sdk iphonesimulator -project Xcode/SDL_image.xcodeproj -target "Static Library" -configuration Release
[DEBUG   ] 
[DEBUG   ] Build settings from command line:
[DEBUG   ]     ARCHS = x86_64
[DEBUG   ]     BITCODE_GENERATION_MODE = bitcode
[DEBUG   ]     HEADER_SEARCH_PATHS = /Users/Anton/KivyIOS/kivy-ios/dist/include/common/sdl2
[DEBUG   ]     IDEBuildOperationMaxNumberOfConcurrentCompileTasks = 4
[DEBUG   ]     ONLY_ACTIVE_ARCH = NO
[DEBUG   ]     SDKROOT = iphonesimulator14.4
[DEBUG   ] 
[DEBUG   ] 2023-01-29 21:00:46.061 xcodebuild[40151:325669] NOTE: Referenced project avif was written by a newer Xcode version (55) -- temporarily downgrading it (without modifying project file)
[DEBUG   ] 2023-01-29 21:00:46.182 xcodebuild[40151:325669] NOTE: Referenced project jxl was written by a newer Xcode version (55) -- temporarily downgrading it (without modifying project file)
[DEBUG   ] 2023-01-29 21:00:46.200 xcodebuild[40151:325669] NOTE: Referenced project webp was written by a newer Xcode version (55) -- temporarily downgrading it (without modifying project file)
[DEBUG   ] NOTE: Xcode project 'SDL_image' was written by a newer Xcode version (55) -- temporarily downgrading it (without modifying project file)
[DEBUG   ] 
[DEBUG   ] note: Using new build system
[DEBUG   ] note: Planning build
[DEBUG   ] note: Constructing build description
[DEBUG   ] warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Static Library' from project 'SDL_image')
[DEBUG   ] warning: Traditional headermap style is no longer supported; please migrate to using separate headermaps and set 'ALWAYS_SEARCH_USER_PATHS' to NO. (in target 'Static Library' from project 'SDL_image')
[DEBUG   ] error: ApplicationServices is not available when building for iOS Simulator. (in target 'Static Library' from project 'SDL_image')
[DEBUG   ] 
[DEBUG   ] ** BUILD FAILED **

Versions

Here is a similar error (but on a different Mac computer) - https://github.com/kivy/buildozer/issues/1547 But here it does not even come to the build of the package. Everything crashes even when compiling Kivy.

misl6 commented 1 year ago

Hi @HeaTTheatR !

After an investigation, I can confirm that SDL XCode projects only support XCode >= 13 , as projects have been migrated to multi-platform support.

You can force the PLATFORM variable to iOS on XCode < 13, but it's unsupported (by us, and by Apple: App Store submission requirement starts April 25 )

I will submit a PR that updates our docs, to reflect this requirement.