Buildozer生成失败:未指定Android SDK目录,正在退出



我试图用buildozer创建一个APK。问题是:当我启动这个命令来构建APk时,我收到了这个错误:

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

所以我试着用sudo这样做这个命令:

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

但我返回这个:

/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.

我该怎么办?

试试这个:

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

然后再次运行buildozer:

buildozer -v android debug

系统会多次提示您同意使用许可证。你需要键入"y",而不仅仅是空格或回车。

做完这些之后,一切都应该按预期进行。

相关内容

最新更新