2

I was trying to get an app that I programmed in Python using Kivy to run on an Xcode simulator. I followed these instructions from link seemingly without issues. Note: I have Kivy installed and use it within Anaconda / Spyder.

Running the Xcode project for the first time brought up the following error (the build didn't succeed):
in /Users/.../Documents/NR4/kivy-ios/dist/lib/libsdl2_image.a(IMG_bmp.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../Documents/NR4/kivy-ios/dist/lib/libsdl2_image.a' for architecture arm64

I solved this the following way: Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

When running the project now, I get the error:

ModuleNotFoundError: No module named 'kivy'

1 and the app crashes.

Thank you for taking the time to read through.

I would greatly appreciate help or ideas related to the problem.

Nick
  • 21
  • 3
  • Hi Nick, I am having the exact same problem. I think it may have something to do with me using a package manager (pipenv). Did you use a package manager? – jda5 Oct 12 '20 at 15:05
  • Nick, I've discovered something that might be worth looking into... In the terminal I entered `sudo python ./toolchain.py pip install kivy` thinking that if it can't find Kivy then I should just install it. This produced an error saying something about installing something to kivy-ios/dist/hostpython3/bin/python3.8. BUT Kivy isn't compatible with Python 3.8 !! It might be worth seeing what the default Python version is on your system, and changing it to 3.7 – jda5 Oct 12 '20 at 15:16
  • Nope. My previous comment wasn't the issue :( I have Python 3.8.2 installed on my computer which coincidentally is the latest version of the python3 recipe in the toolchain. Still stuck. What have you tried? – jda5 Oct 12 '20 at 16:54
  • Hi Jacob, thank you for commenting! Did you use the instructions provided by Github? I use the anaconda package manager. Regarding the Kivy being incompatible would explain the fact that on their instructions page https://kivy.org/doc/stable/guide/packaging-ios.html it says they only support Python 2.7. Nevertheless, Github does provide instructions that are supposed to work with Python 3. – Nick Oct 13 '20 at 07:34
  • I used the instructions on GitHub as well as a video on YouTube. You? Hmm, I was told it is supposed to work with python 3. I think I have found out exactly what the problem is (though don't yet have a solution). Entering `toolchain status` in the terminal, brings up the recipes that have been built. It says there that Kivy has not been built, but python3 has. Indeed, when I enter `toolchain build kivy` I get an error message. Someone posted this same issue on the kivy-ios GitHub page, and today I am going to try what the final comment recommends https://github.com/kivy/kivy-ios/issues/555 – jda5 Oct 13 '20 at 08:44
  • Thank you Jacob, that gives me hope. I'll try what you recommended. – Nick Oct 13 '20 at 09:03
  • 1
    After following the instructions you recommended and building with toolchain again running toolchain status shows Build ok for Kivy. I will now try making an Xcode project. – Nick Oct 13 '20 at 09:38
  • Thank you so much, it works now!! Let me know if it works for you. – Nick Oct 13 '20 at 09:46
  • It works for me too!!!! So glad to hear that it works for you as well. – jda5 Oct 13 '20 at 09:47
  • Oh, wonderful, I'm very glad. – Nick Oct 13 '20 at 10:00

1 Answers1

0

Installing a newer version of Cython before building with toolchian resolved the problem for me.

pip3 install Cython==0.29.17
Nick
  • 21
  • 3