Buildozer Build failed: Android SDK dir was not specified, exiting

399 views Asked by At

I try to create an APK with buildozer. The problem is: when I launch this command to build the APk, I received this error:

python3 -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name Population-package --name Population --version 0.1 --package ewan grignoux levert.population-package --minsdk 21 --ndk-api 21 --private /home/ewangl/Documents/NSI/Projets/Population/.buildozer/android/app --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/ewangl/Documents/NSI/Projets/Population/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21

So I try to do this command with sudo like that:

sudo python3 -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name Population-package --name Population --version 0.1 --package ewan grignoux levert.population-package --minsdk 21 --ndk-api 21 --private /home/ewangl/Documents/NSI/Projets/Population/.buildozer/android/app --android-entrypoint org.kivy.android.PythonActivity --android-apptheme @android:style/Theme.NoTitleBar --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/ewangl/Documents/NSI/Projets/Population/.buildozer/android/platform/build-armeabi-v7a" --ndk-api=21

But I return this:

    /usr/local/lib/python3.8/dist-packages/pythonforandroid/toolchain.py:84: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
[INFO]:    Will compile for the following archs: armeabi-v7a
[ERROR]:   Build failed: Android SDK dir was not specified, exiting.

What I have to do?

1

There are 1 answers

0
calabash On

Try this:

rm -rf ~/<your project dir>/.buildozer

Then run buildozer again:

buildozer -v android debug

You will be prompted to agree to licences a few times. You need to type 'y' not just hit space or enter.

After doing this all should work as expected.