jjwood1600
jjwood1600

Reputation: 47

Could not find hostpython, will not compile to .pyo (Buildozer python-to-android)

I'm using Buildozer to convert a python file to android APK (using Kivy) and it gets quite far through the process but then errors.

Any ideas what is causing this error at the end?

toolchain.py: error: unrecognized arguments: --sdk 19 Could not find hostpython, will not compile to .pyo (this is normal with python3)

Command failed: /usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name KivyTest --name KivyApp --version 0.1 --package doublejgames.com.kivytest --android_api 19 --sdk 19 --minsdk 9 --private /home/kivy/Desktop/.buildozer/android/app --orientation landscape --copy-libs --arch armeabi-v7a --color=always --storage-dir=/home/kivy/Desktop/.buildozer/android/platform/build

This seems to be the main error:

toolchain.py: error: unrecognized arguments: --sdk 19 Could not find hostpython, will not compile to .pyo (this is normal with python3)

In my buildozer.spec file, I'm using the requirements:

requirements = kivy, python3crystax==3.6

I also tried just

requirements = kivy, python3crystax

Any help would be appreciated! Thanks.

Upvotes: 0

Views: 909

Answers (2)

peaceful mind
peaceful mind

Reputation: 11

specify the requirments with the version in the .spec file which you run in your local machine which building the application. try to run python 3.7 or 3.6 python does not support version than 3.9

Upvotes: 1

inclement
inclement

Reputation: 29488

The error is the 'error: unrecognized arguments: --sdk 19' part, the rest is not important. The problem arises from a regression in python-for-android, as this argument was removed but is still passed by buildozer. I've re-added the argument (with a deprecation warning) and created a PR to stop buildozer calling it anyway. This means that if you clean everything and try again, the error should no longer occur.

Upvotes: 0

Related Questions