当我尝试buildozer android debug时遇到错误,昨天我遇到了这个问题,今天早上我将Java版本更改为8,它的工作原理像一个魅力,可以在我的手机上运行。早些时候,我使用笔记本电脑进一步开发了我的应用程序(面部识别),当我将其传输回Linux PC时,再次出现此错误。
更改的Java版本 在只有我的.py和.kv文件的目录中尝试过
这是错误:
# Check configuration tokens
# Ensure build layout
# Create directory /home/james/PycharmProjects/test_cam_3/.buildozer
# Create directory /home/james/PycharmProjects/test_cam_3/bin
# Create directory /home/james/PycharmProjects/test_cam_3/.buildozer/applibs
# Create directory /home/james/PycharmProjects/test_cam_3/.buildozer/android/platform
# Create directory /home/james/PycharmProjects/test_cam_3/.buildozer/android/app
# 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.6 (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 /home/james/.local/bin/cython
# Search for Java compiler (javac)
# -> found at /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
# Search for Java keytool (keytool)
# -> found at /usr/lib/jvm/java-13-oracle/bin/keytool
# Install platform
# Run 'git clone -b master --single-branch https://github.com/kivy/python-for-android.git python-for-android'
# Cwd /home/james/PycharmProjects/test_cam_3/.buildozer/android/platform
Cloning into 'python-for-android'...
# Run '/usr/bin/python3 -m pip install -q --user \'appdirs\' \'colorama>=0.3.3\' \'jinja2\' \'six\' \'enum34; python_version<"3.4"\' \'sh>=1.10; sys_platform!="nt"\' \'pep517\' \'pytoml\' \'virtualenv\''
# Cwd None
# Apache ANT found at /home/james/.buildozer/android/platform/apache-ant-1.9.4
# Android SDK found at /home/james/.buildozer/android/platform/android-sdk
# Android NDK found at /home/james/.buildozer/android/platform/android-ndk-r17c
# Installing/updating SDK platform tools if necessary
# Run '/home/james/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools'
# Cwd /home/james/.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:604)
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/james/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager tools platform-tools
# ENVIRONMENT:
# SHELL = '/bin/bash'
# SESSION_MANAGER = 'local/pop-os:@/tmp/.ICE-unix/1695,unix/pop-os:/tmp/.ICE-unix/1695'
# QT_ACCESSIBILITY = '1'
# COLORTERM = 'truecolor'
# XDG_CONFIG_DIRS = '/etc/xdg/xdg-pop:/etc/xdg'
# XDG_MENU_PREFIX = 'gnome-'
# GNOME_DESKTOP_SESSION_ID = 'this-is-deprecated'
# GTK_IM_MODULE = 'ibus'
# DERBY_HOME = '/usr/lib/jvm/java-13-oracle/db'
# LANGUAGE = 'en_US:en'
# QT4_IM_MODULE = 'xim'
# MANDATORY_PATH = '/usr/share/gconf/pop.mandatory.path'
# JAVA_HOME = '/usr/lib/jvm/java-13-oracle'
# GNOME_SHELL_SESSION_MODE = 'pop'
# SSH_AUTH_SOCK = '/run/user/1000/keyring/ssh'
# XMODIFIERS = '@im=ibus'
# DESKTOP_SESSION = 'pop'
# SSH_AGENT_PID = '1803'
# GTK_MODULES = 'gail:atk-bridge'
# DBUS_STARTER_BUS_TYPE = 'session'
# XDG_SEAT = 'seat0'
# PWD = '/home/james/PycharmProjects/test_cam_3'
# LOGNAME = 'james'
# XDG_SESSION_DESKTOP = 'pop'
# XDG_SESSION_TYPE = 'x11'
# GPG_AGENT_INFO = '/run/user/1000/gnupg/S.gpg-agent:0:1'
# XAUTHORITY = '/run/user/1000/gdm/Xauthority'
# J2REDIR = '/usr/lib/jvm/java-13-oracle'
# WINDOWPATH = '2'
# HOME = '/home/james'
# USERNAME = 'james'
# IM_CONFIG_PHASE = '2'
# LANG = 'en_US.UTF-8'
# 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 = 'pop:GNOME'
# VTE_VERSION = '5602'
# GNOME_TERMINAL_SCREEN = '/org/gnome/Terminal/screen/8eb29b0f_6b5d_425a_ac35_91aee045f555'
# INVOCATION_ID = '2bdca02d767d4ed68640ac45f24028e2'
# MANAGERPID = '1647'
# CLUTTER_IM_MODULE = 'xim'
# LESSCLOSE = '/usr/bin/lesspipe %s %s'
# XDG_SESSION_CLASS = 'user'
# TERM = 'xterm-256color'
# DEFAULTS_PATH = '/usr/share/gconf/pop.default.path'
# J2SDKDIR = '/usr/lib/jvm/java-13-oracle'
# LESSOPEN = '| /usr/bin/lesspipe %s'
# USER = 'james'
# GNOME_TERMINAL_SERVICE = ':1.113'
# DISPLAY = ':1'
# SHLVL = '1'
# QT_IM_MODULE = 'ibus'
# XDG_VTNR = '2'
# XDG_SESSION_ID = '2'
# DBUS_STARTER_ADDRESS = 'unix:path=/run/user/1000/bus,guid=766e13c8e3d23cbd700709d35da1aceb'
# XDG_RUNTIME_DIR = '/run/user/1000'
# JOURNAL_STREAM = '9:30474'
# XDG_DATA_DIRS = '/usr/share/pop:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop'
# PATH = '/home/james/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/james/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-13-oracle/bin:/usr/lib/jvm/java-13-oracle/db/bin:/home/james/.local/bin/'
# GDMSESSION = 'pop'
# DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/user/1000/bus,guid=766e13c8e3d23cbd700709d35da1aceb'
# _ = '/home/james/.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版本
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~19.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
非常感谢您抽出宝贵的时间。