-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenJDK 11 incompatibility beacuse of Gradle 8.x / cannot build apk on WSL v1 #3000
Comments
To temporary workaround an issue, just uncomment and set following line within your buildozer.spec file: |
Is there anything we can do (apart of downgrading things) to keep the "support" for WSL1 ? The suggestion is always to avoid using WSL1 / WSL2, but I know that for someone that's the only option. |
Unfortunatelly not really. I tried OpenJDK 21 also with WSL v1, it behaves same as OpenJDK 17. Same on Ubuntu 20.04.6 LTS and 22.04.3 LTS. Ubuntu 18.04.6 LTS is no longer useable with Buildozer 1.5.0 as long it comes with Python 3.6, but Buildozer 1.5.0 requires at least Python 3.8 (exception using Python 3.6: AttributeError: module 'shlex' has no attribute 'join'). The issue with OpenJDK 17+ looks really annoying, because it happens during file copy operation. Part of files are copied fine, but it always fail on random file. I tried to analyze it but see no clear reason. Method used to copy files have to be different in OpenJDK 11, comparing to 17 and 21. Java method tries to set permissions after copying file and probably it is not fully compatible with way of file handling implemented in WSL v1. It's really annoying, knowing that part of files are copied fine, but for some files it always fail. I know that downgrading Gradle to 7.x is short term solution, as long probably in future more modern Gradle and Gradle plugin versions will be required, but for now my pull request #3006 fully solves reason why Gradle was upgraded to 8.x #2887. Latest 7.x does not show any warning about untested |
works for me ,thank you! |
https://docs.python.org/3/library/shlex.html#shlex.join was added in Python 3.8 and is present in Python 3.8 thru 3.13. Given that Python 3.8 and less are end-of-life, why is this still an issue? |
This issue is not related to Python version. It's related to Java version on WSL v1, used by Gradle 7.x and 8.x by Buildozer. |
Checklist
p4a.branch = develop
)Versions
Same behaviour on two PCs.
Description
Buildozer cannot build apk with JDK 11 because of Gradle 8.x JDK 17 requirement.
On the other hand there is no possibility to build apk using Java 17 on WSL v1, because of this issue:
kivy/buildozer#1504
Switchining JDK 11 to 17 generates "Cannot allocate memory" both by Gradle 7.x and 8.x during mergeReleaseJniLibFolders task using Buildozer 1.4.0 and 1.5.0 on Ubuntu 20.04.6 and 22.04.3, having project on Linux partition or Windows partition.
Current python-for-android (develop and master branch) uses Gradle plugin 8.1.1 with Gradle 8.0.2, because of this commit:
#2887
Same goal, I man no following warning:
can be achieved by using latest 7.x Android Gradle Plugin and Gradle.
To fix it within:
https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/bootstraps/common/build/gradle/wrapper/gradle-wrapper.properties
please change:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
and within:
https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle
please change:
classpath 'com.android.tools.build:gradle:8.1.1'
to
classpath 'com.android.tools.build:gradle:7.4.2'
Downgrading both keeps JDK 11 compatibility and what's more important to keep ability to build apk using Gradle on Ubuntu running on WSL under Windows OS.
buildozer.spec
Command:
Spec file:
Logs
The text was updated successfully, but these errors were encountered: