I’m building a mobile app with Python and Kivy and I want to compile it for iOS.
I have:
- kivy-ios installed
- Python 3.9
- Xcode 13.2
- Xcode command line tools
- macOS 11.7.10
I followed the guidelines in the official kivy documetation: https://kivy.org/doc/stable/guide/packaging-ios.html
And I managed to get to the toolchain part.
When I run the toolchain build kivy
command in the macOS terminal, I’m getting this error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/bin/toolchain", line 5, in <module>
from kivy_ios.toolchain import main
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 241, in <module>
class Arch64Simulator(Arch):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 246, in Arch64Simulator
sysroot = sh.xcrun("--sdk", "iphonesimulator", "--show-sdk-path").strip()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 1508, in __call__
rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 737, in __init__
self.wait()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 799, in wait
self.handle_command_exit_code(exit_code)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 826, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_1:
RAN: /usr/bin/xcrun --sdk iphonesimulator --show-sdk-path
STDOUT:
STDERR:
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: SDK "iphonesimulator" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphonesimulator'
Does someone know how to fix this ?
I’ve saw that some people said that in this case you need to go in the Xcode preferences/settings section and do some stuff but I can’t find them on my Xcode version.
Maybe the problem is elsewhere.