Buildozer java erro



我是kivy和buildozer的新手。此外,我第一次运行buildozer来为android构建应用程序。我编写了一个应用程序,它在python解释器上运行良好,没有任何错误。所以我继续将代码转换为android的应用程序,因为kivy是一种跨平台编程语言,但当我开始构建应用程序时,我遇到了一个奇怪的错误,因为我是新手,我不知道解决方案是什么,所以请帮我!在安装buildozer之后,我只制作了一个.spec文件,并在不编辑.spec的情况下开始调试,以测试一切是否正常。在运行buildozer时,它下载了sdk和ndk并安装了它们,但在安装它们之后,它会出现一个长错误,我在下面给出了它的日志,所以请查看它,并尽早提供帮助,以便我可以了解并从kivy中获得更多信息。提前感谢

# Check configuration tokens
# Read available permissions from api-versions.xml
# Preparing build
# Check requirements for android
# Run 'dpkg --version'
# Cwd None
Debian 'dpkg' package management program version 1.19.7 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.
# Search for Git (git)
#  -> found at /usr/bin/git
# Search for Cython (cython)
#  -> found at /usr/bin/cython
# Search for Java compiler (javac)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
#  -> found at /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool
# Install platform
# Run 'git config --get remote.origin.url'
# Cwd /root/Documents/CoronaKivy/.buildozer/android/platform/python-for-android
https://github.com/kivy/python-for-android.git
# Run 'git branch -vv'
# Cwd /root/Documents/CoronaKivy/.buildozer/android/platform/python-for-android
* master 8cf66cc1 [origin/master] Merge pull request #2111 from kivy/release-2020.03.30
# Run '/usr/bin/python3.7 -m pip install -q --user 'appdirs' 'colorama>=0.3.3' 'jinja2' 'six' 'enum34; python_version<"3.4"' 'sh>=1.10; sys_platform!="nt"' 'pep517<0.7.0"' 'pytoml' 'virtualenv<20''
# Cwd None
# Apache ANT found at /root/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /root/.buildozer/android/platform/android-sdk
# Recommended android's NDK version by p4a is: 19b
# Android NDK found at /root/.buildozer/android/platform/android-ndk-r19b
# Installing/updating SDK platform tools if necessary
# Run '/root/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools'
# Cwd /root/.buildozer/android/platform/android-sdk
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
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:581)
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: /root/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools
# ENVIRONMENT:
#     SHELL = '/bin/bash'
#     SESSION_MANAGER = 'local/kali:@/tmp/.ICE-unix/1329,unix/kali:/tmp/.ICE-unix/1329'
#     QT_ACCESSIBILITY = '1'
#     COLORTERM = 'truecolor'
#     XDG_MENU_PREFIX = 'gnome-'
#     GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
#     GTK_IM_MODULE = 'ibus'
#     LANGUAGE = 'en_IN:en'
#     QT4_IM_MODULE = 'ibus'
#     SSH_AUTH_SOCK = '/run/user/0/keyring/ssh'
#     XMODIFIERS = '@im=ibus'
#     DESKTOP_SESSION = 'gnome'
#     SSH_AGENT_PID = '1282'
#     GTK_MODULES = 'gail:atk-bridge'
#     DBUS_STARTER_BUS_TYPE = 'session'
#     PWD = '/root/Documents/CoronaKivy'
#     LOGNAME = 'root'
#     XDG_SESSION_DESKTOP = 'gnome'
#     QT_QPA_PLATFORMTHEME = 'qt5ct'
#     XDG_SESSION_TYPE = 'x11'
#     GPG_AGENT_INFO = '/run/user/0/gnupg/S.gpg-agent:0:1'
#     XAUTHORITY = '/run/user/0/gdm/Xauthority'
#     WINDOWPATH = '2'
#     GDM_LANG = 'en_IN'
#     HOME = '/root'
#     USERNAME = 'root'
#     IM_CONFIG_PHASE = '1'
#     LANG = 'en_IN'
#     LS_COLORS = 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:'
#     XDG_CURRENT_DESKTOP = 'GNOME'
#     VTE_VERSION = '6000'
#     GNOME_TERMINAL_SCREEN = '/org/gnome/Terminal/screen/a738ed9c_93c5_47ac_8f3a_19686d6ae6bd'
#     INVOCATION_ID = '03fd0c25e1254af3adc502f37fccdaac'
#     MANAGERPID = '1136'
#     CLUTTER_IM_MODULE = 'ibus'
#     XDG_SESSION_CLASS = 'user'
#     TERM = 'xterm-256color'
#     USER = 'root'
#     GNOME_TERMINAL_SERVICE = ':1.236'
#     DISPLAY = ':1'
#     SHLVL = '1'
#     QT_IM_MODULE = 'ibus'
#     DBUS_STARTER_ADDRESS = 'unix:path=/run/user/0/bus,guid=d7f786b64d6c4a995f2f8dbc5e8af503'
#     XDG_RUNTIME_DIR = '/run/user/0'
#     QT_AUTO_SCREEN_SCALE_FACTOR = '0'
#     JOURNAL_STREAM = '9:29874'
#     XDG_DATA_DIRS = '/usr/share/gnome:/usr/local/share/:/usr/share/'
#     PATH = '/root/.buildozer/android/platform/apache-ant-1.9.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
#     GDMSESSION = 'gnome'
#     DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/0/bus,guid=d7f786b64d6c4a995f2f8dbc5e8af503'
#     _JAVA_OPTIONS = '-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
#     _ = '/usr/local/bin/buildozer'
# 
# 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

我遇到了同样的问题。问题是我没有使用正确的java版本。我使用的是jdk-11,但我不得不使用OpenJDK-8-jdk。请使用命令检查您的java版本

java -version 

这将向您展示java版本。现在,当它没有显示"OpenJDK 1.8.0_242版本"时考虑使用安装


sudo apt install -y git zip unzip openjdk-8-jdk

当您想在java版本之间切换时。使用命令

sudo update-alternatives --config java

请告诉我这是否有效

相关内容

  • 没有找到相关文章

最新更新