如何使用buildozer打包我的kivy应用程序时修复'java.lang.module.FindException:module java.se.ee not found'错误

问题描述 投票:0回答:2

我正在尝试打包我的kivy应用程序(python3)但是当我运行命令buildozer -v android debug时看到此错误

# Cwd /home/javier/.buildozer/android/platform/android-sdk
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
# Command failed: /home/javier/.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

我有这个Java版本

$ java --version
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment (build 11.0.2+9-Ubuntu-3ubuntu118.04.3)
OpenJDK 64-Bit Server VM (build 11.0.2+9-Ubuntu-3ubuntu118.04.3, mixed mode, sharing)

我只下载了sdkmanager命令行工具from here并把它放在我的根路径中,但我没有成功。

我在this post看到了一个解决方案,我做到了但我没有解决错误。

我有一个virtualenv安装了所有依赖项。我也编辑了buildozer.spec,我定制了它

Virtualenv是:

(envAppSinapsis)~/AppSin$ pip freeze
certifi==2019.3.9
chardet==3.0.4
Cython==0.28.2
docutils==0.14
idna==2.8
Kivy==1.10.1
Kivy-Garden==0.1.4
psycopg2==2.7.6.1
psycopg2-binary==2.7.6.1
pygame==1.9.4.dev0
Pygments==2.3.1
requests==2.21.0
urllib3==1.24.1

我认为这个错误与JAVA有关,但我不知道是什么。我很感激你的帮助,请原谅我糟糕的英语。

我在Ubuntu 18工作

更新Print Screen Error

android python kivy buildozer
2个回答
3
投票

直到几天前,如果你从Ubuntu repos安装了openjdk-11-jdk / jre,你会发现它实际上是Java 10的版本(https://askubuntu.com/questions/1037646/why-is-openjdk-10-packaged-as-openjdk-11)。

java.se.ee在Java 9,10中已被弃用,在Java 11中被删除(https://www.oracle.com/technetwork/java/javase/11-relnote-issues-5012449.html

不幸的是,没有简单的方法可以让像sdkmanager或av​​dmanager这样的Android工具运行Java 11。

我能够使用Java 10再次在Ubuntu上运行buildozer:

  • http://jdk.java.net/java-se-ri/10下载Java 10 Linux x64 JDK(.tar.gz)
  • 涂抹:tar -xzvf jdk-10_linux-x64_bin_ri.tar.gz
  • 设置路径:export PATH=/path/to/inflated/jdk-10/bin:$PATH

-1
投票

您可以通过降级Java或在终端中执行以下命令来解决此错误。

export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'

另外,不要自己下载平台工具,让buildozer负责。

如果上述命令不起作用,请尝试从应用程序中删除buildozer文件并重建应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.