随pip3一起安装:
我正在关注this RealPython tutorial并且在这样做之后:
$ buildozer -v android debug
PyCharm在终端上显示此内容,抱怨某些xml模式问题:
# Run '/home/madtyn/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools'
# Cwd /home/madtyn/.buildozer/android/platform/android-sdk
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
# Command failed: /home/madtyn/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools
#
# 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
我应该说我尝试卸载JDK 1.11,JDK 1.8和JDK 13(Zulu)。
答案 0 :(得分:0)
鉴于我尝试了几项操作并最终获得了成功,但是我不知道到底是哪一步成功完成了,所以我将逐步描述我所做的一切。
在用于与buildozer打包的文件夹中,我删除了该文件夹
$ rm -rf .buildozer/
卸载了我的JDK,它是zulu JDK13
根据某人的建议,我安装了一些依赖项。请注意,这里有一个JDK:
$ sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake
此刻,我再次尝试:
$ buildozer -v android debug
更新/安装了最现代的cython和kivy:
$ pip3 install -U cython==0.29.6
# I think pip3 install --upgrade cython would have been just fine
$ pip3 install --upgrade kivy
我安装了另一个依赖项,它可能是必需的,也可能不是必需的:
$ sudo apt install aidl
我终于启动了成功的last命令,该命令耗时约20分钟:
$ buildozer -v android debug
这创建了apk。 cython和kivy版本在某些情况下似乎具有兼容版本,因此您应该特别注意这一点。拥有最新版本不会造成任何伤害。