Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Buildozer problem with gradlew (java version?)

101 views
Skip to first unread message

Frédéric

unread,
Oct 14, 2024, 7:27:04 AM10/14/24
to Kivy users support
Hi,

When Building a program for Android, I've got this message

running gradlew clean assembleDebug
[DEBUG]:
[DEBUG]:   FAILURE: Build failed with an exception.
[DEBUG]:  
[DEBUG]:   * What went wrong:
[DEBUG]:   A problem occurred configuring root project 'Brainbow'.
[DEBUG]:   > Could not open cp_proj generic class cache for build file '/home/frederic/Kivy_shared/Brain-bow/.buildozer/android/platform/build-arm64-v8a_armeabi-v7a/dists/Brainbow/build.gradle' (/home/frederic/.gradle/caches/8.0.2/scripts/5dvofcs26ca0eny7v4zjxz09u).
[DEBUG]:      > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65

The problem occured after I upgraded my PC Ubuntu's version (Ubuntu 24.04.1 LTS)
I red on Internet that the last message was from gradle, a problem with  java's version,
My java version is 21.0.4, Buildozer version is 1.5.0

I think that gradlew is automatically installed by Buildozer, and it seems to be an old version?
What are my options to select gradle's version in Buildozer?

Thanks for any help,
Frederic

demetrius cyprian

unread,
Oct 14, 2024, 7:44:57 AM10/14/24
to kivy-...@googlegroups.com
Update the java version or try to uninstall it!

Frédéric

unread,
Oct 14, 2024, 7:52:16 AM10/14/24
to Kivy users support
Thanks,

I didn't explain clearly:
In fact, my Java version is too high for the gradle buildozer uses
(That's what I understand when searching 
BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65
on internet)

demetrius cyprian

unread,
Oct 14, 2024, 7:56:49 AM10/14/24
to kivy-...@googlegroups.com
Ok! I get your point! Search in the internet the java version which is compartible to your gradle buildozer. Then downgrade your java vaersion to that version of gradle buildozer which is on your machine! I hope it will work for you!

Frédéric

unread,
Oct 14, 2024, 1:31:18 PM10/14/24
to Kivy users support
That's the problem,
I don't know how buildozer select gradlew, which version.

And I don't want to downgrade Java, i'll probably have other problems if I do that 

Radosław Głębicki

unread,
Oct 14, 2024, 3:34:10 PM10/14/24
to Kivy users support
install another version java and for compilation use terminal command: alternatives

berk berk

unread,
Oct 26, 2024, 8:32:11 AM10/26/24
to Kivy users support
Steps:

1- pip3 install --user --upgrade buildozer

2- sudo apt update <<your password>>

3- sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev

4- pip3 install --user --upgrade Cython==0.29.33 virtualenv

5- export PATH=$PATH:~/.local/bin/

6- buildozer init <<edit buildozer>>
 *prepared buildozer.spec in file.

7- buildozer android debug deploy run

*Ubuntu 20.04.6 LTS   --WSL version 2 (command on cmd to show wsl version: wsl -l -v)
Checked everthing is ok.

On Google COLAB:

1- !pip install buildozer

2- !pip install cython==0.29.33

3- !sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev

4- !buildozer init

5- !buildozer -v android debug

*Tested, everything is ok.

Further reading:
https://github.com/mathpathconsole/Kivy-android-apk-with-Google-Colab 
https://buildozer.readthedocs.io/en/latest/installation.html#android-on-windows-10-or-11 


 


14 Ekim 2024 Pazartesi tarihinde saat 22:34:10 UTC+3 itibarıyla glebicki...@gmail.com şunları yazdı:

Frédéric

unread,
Dec 13, 2024, 11:36:28 AM12/13/24
to Kivy users support
In fact, it was quite simple...

The old version of Python was always on my computer

I just had to do 
    sudo update-alternatives --config java
and select the old version (Java 17)

Radosław Głębicki

unread,
Dec 13, 2024, 10:09:53 PM12/13/24
to Kivy users support
14th of October I wrote about using alternatives to change java version. Do you read even posts?
Reply all
Reply to author
Forward
0 new messages