I have successfully converted multiple Kivy applications into APKs using GitHub Actions. However, I recently encountered an issue when trying to convert a new Kivy app. Despite using the same setup and configuration, the build process failed with an error related to Java version compatibility.
buildozer.spec
requirements = python3==3.9.12, hostpython3==3.9.12, kivy==2.2.1, kivymd==1.1.1, pillow
osx.python_version = 3
osx.kivy_version = 2.2.1
# (int) Target Android API, should be as high as possible.
android.api = 31
# (bool) If True, then automatically accept SDK license
android.accept_sdk_license = True
# (list) Gradle dependencies to add
#android.gradle_dependencies =
#android.enable_androidx = True
#android.add_gradle_repositories =
#android.add_packaging_options =
android.archs = arm64-v8a, armeabi-v7a
# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True
# (str) Bootstrap to use for android builds
# Python for android (p4a) specific
#p4a.url =
#p4a.fork = kivy
p4a.branch = master
#p4a.commit = HEAD
#p4a.source_dir =
#p4a.local_recipes =
#p4a.hook =
# p4a.bootstrap = sdl2
#p4a.port =
#p4a.setup_py = false
#p4a.extra_args =
[buildozer]
# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2
# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1
Error log
2024-03-22T22:51:38.0864944Z Welcome to Gradle 8.0.2! 2024-03-22T22:51:38.0865239Z 2024-03-22T22:51:38.0865440Z Here are the highlights of this release: 2024-03-22T22:51:38.0866065Z - Improvements to the Kotlin DSL 2024-03-22T22:51:38.0866899Z - Fine-grained parallelism from the first build with configuration cache 2024-03-22T22:51:38.0867798Z - Configurable Gradle user home cache cleanup 2024-03-22T22:51:38.0868210Z 2024-03-22T22:51:38.0869253Z 2024-03-22T22:51:38.0869573Z Starting a Gradle Daemon (subsequent builds will be faster) 2024-03-22T22:51:38.0870091Z 2024-03-22T22:51:38.0870292Z FAILURE: Build failed with an exception. 2024-03-22T22:51:38.0870690Z 2024-03-22T22:51:38.0870828Z * Where: 2024-03-22T22:51:38.0872038Z Build file '/github/workspace/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/UniversalConvert/build.gradle' line: 20 2024-03-22T22:51:38.0873120Z 2024-03-22T22:51:38.0873281Z * What went wrong: 2024-03-22T22:51:38.0873962Z A problem occurred evaluating root project 'UniversalConvert'. 2024-03-22T22:51:38.0874932Z > Failed to apply plugin 'com.android.internal.application'. 2024-03-22T22:51:38.0875961Z > Android Gradle plugin requires Java 17 to run. You are currently using Java 13. 2024-03-22T22:51:38.0877117Z Your current JDK is located in /usr/lib/jvm/java-13-openjdk-amd64 2024-03-22T22:51:38.0877930Z You can try some of the following options: 2024-03-22T22:51:38.0878590Z - changing the IDE settings. 2024-03-22T22:51:38.0879259Z - changing the JAVA_HOME environment variable. 2024-03-22T22:51:38.0880268Z - changing
org.gradle.java.homeingradle.properties. 2024-03-22T22:51:38.0880813Z 2024-03-22T22:51:38.0880952Z * Try: 2024-03-22T22:51:38.0881493Z > Run with --stacktrace option to get the stack trace. 2024-03-22T22:51:38.0882517Z > Run with --info or --debug option to get more log output. 2024-03-22T22:51:38.0883319Z > Run with --scan to get full insights. 2024-03-22T22:51:38.0883730Z 2024-03-22T22:51:38.0884388Z 2024-03-22T22:51:38.0884870Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. 2024-03-22T22:51:38.0885536Z 2024-03-22T22:51:38.0886401Z You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. 2024-03-22T22:51:38.0887492Z 2024-03-22T22:51:38.0888124Z See https://docs.gradle.org/8.0.2/userguide/command_line_interface.html#sec:command_line_warnings 2024-03-22T22:51:38.0888992Z 2024-03-22T22:51:38.0889159Z BUILD FAILED in 29s 2024-03-22T22:51:38.0889427Z 2024-03-22T22:51:38.0889433Z 2024-03-22T22:51:38.0889565Z STDERR: 2024-03-22T22:51:38.0889781Z 2024-03-22T22:51:38.0890098Z [1m[INFO][0m: STDOUT (last 20 lines of 45): 2024-03-22T22:51:38.0891067Z [33m Your current JDK is located in /usr/lib/jvm/java-13-openjdk-amd64 2024-03-22T22:51:38.0892015Z You can try some of the following options: 2024-03-22T22:51:38.0892725Z - changing the IDE settings.
2024-03-22T22:51:38.0893818Z - changing the JAVA_HOME environment variable.
2024-03-22T22:51:38.0894682Z - changingorg.gradle.java.homeingradle.properties. 2024-03-22T22:51:38.0895350Z
2024-03-22T22:51:38.0895660Z * Try:
2024-03-22T22:51:38.0896203Z > Run with --stacktrace option to get the stack trace.
2024-03-22T22:51:38.0897090Z > Run with --info or --debug option to get more log output.
2024-03-22T22:51:38.0897865Z > Run with --scan to get full insights.
2024-03-22T22:51:38.0898378Z
2024-03-22T22:51:38.0898788Z * Get more help at https://help.gradle.org
2024-03-22T22:51:38.0899495Z
2024-03-22T22:51:38.0900233Z Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
2024-03-22T22:51:38.0901152Z
2024-03-22T22:51:38.0902378Z You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
2024-03-22T22:51:38.0903582Z
2024-03-22T22:51:38.0904359Z See https://docs.gradle.org/8.0.2/userguide/command_line_interface.html#sec:command_line_warnings
2024-03-22T22:51:38.0905307Z
2024-03-22T22:51:38.0905692Z BUILD FAILED in 29s[39m