Search code examples
pythonkivybuildozer

Kivy: Buildozer.spec file is not completed


I prepared kivy buildozer for using. For installation I used instructions here, process for python 3. After step 3, buildozer.spec file wasn't completed and checked lines (step 4) had next content:

requirements = kivy
#android.ndk_path = 

Message about installation after buildozer android debug deploy run:

# Unpacking Android NDK
# Android NDK installation done.
# Check application requirements
# Check garden requirements
# Compile platform
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build
# 
# Buildozer failed to execute the last command
# If the error is not obvious, please raise the log_level to 2
# and retry the latest command.
# In case of a bug report, please add a full log with log_level = 2

What is origin of problems?

I added log_level = 2 to section buildozer, New message:

# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build'
# Cwd /media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are ()
[WARNING]: Requested API target 19 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

I applied addvices of Mikhail Gerasimov and after short step I obtained new message:

# Run '/usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build'
# Cwd /media/sf_ForBuildozer/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Found Android API target in $ANDROIDAPI
[INFO]:    Available Android APIs are ()
[WARNING]: Requested API target 19 is not available, install it with the SDK android tool.
[WARNING]: Exiting.
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir=/media/sf_ForBuildozer/.buildozer/android/platform/build

Solution

  • Problem here is that SDK doesn't contain all stuff to make build for target API. Usually buildozer handles it automatically, but from time to time it breaks. You can install stuff manually through GUI (see link above) or as I usually do it through (linux) console:

    echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter tools
    echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter platform-tools
    echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter build-tools-27.0.2
    echo y | android-sdk-linux/tools/android update sdk --all --no-ui --filter android-19
    

    Make sure your SDK dir avaliable at android-sdk-linux/tools/android. After installing all this I think error should go.