Open Marcinosoft opened 1 month ago
To temporary workaround an issue, just uncomment and set following line within your buildozer.spec file:
p4a.fork = Marcinosoft
It's my fork of https://github.com/kivy/python-for-android repo with downgraded Gradle able to work with OpenJDK 11.
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.
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 https://github.com/kivy/python-for-android/pull/3006 fully solves reason why Gradle was upgraded to 8.x https://github.com/kivy/python-for-android/pull/2887. Latest 7.x does not show any warning about untested android.suppressUnsupportedCompileSdk=33
specyfying android.api = 33
in buildozer.spec.
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: https://github.com/kivy/buildozer/issues/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: https://github.com/kivy/python-for-android/pull/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
todistributionUrl=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'
toclasspath '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