Update Android Gradle Plugin to 8.11.0 and Gradle Wrapper to 8.14.3 + update default API target to 35 in tests #3172
Conversation
* `distributionUrl` now points to `gradle‑8.14.3‑all.zip`
|
I tried to build with a slightly different version (been more conservative), a few days ago, and also seemed fine to me. UPDATE: I see the issue might be the current default target SDK, I guess we should just increase it. 😄 |
|
Checked test results after latest changes, |
|
Hum... got 32 passed, 1 failed here; it seems something went wrong on |
|
Latest stable NDK to build for To override this behavior we can do below:
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,max-page-size=4096")
LOCAL_LDFLAGS += -Wl,-z,max-page-size=4096Overall we need to first add 16KiB support. |
|
@Novfensec SDL won't build in latest NDK until #3164 is pushed. Ref: #3136 (comment) |
APP_ABI := $(ARCH) in Application.mk of service_library is missing :) |
8.11.0 and Gradle Wrapper to 8.14.38.11.0 and Gradle Wrapper to 8.14.3 + update default API target to 35 in tests
…3` + update default API target to `35` in tests (kivy#3172) * 🔧 build: upgrade Gradle wrapper to `8.14.3` * `distributionUrl` now points to `gradle‑8.14.3‑all.zip` * 🔧 build: bump AGP to `8.11.0`, replace `jcenter()` with `mavenCentral()` * Update `android-api` to 35 in `testapps/on_device_unit_tests/setup.py` * Update target android.api to 35 in buildozer.spec * Update `ANDROID_API_LEVEL` to 35 in `android.mk` * Set `APP_PLATFORM` in `Application.mk` to use `NDK_API` * Add `Application.mk` with `APP_PLATFORM` for service_library bootstrap Hopefully [this](https://github.com/kivy/python-for-android/actions/runs/16309986846/job/46063689527?pr=3172) will pass * Define `APP_ABI` variable in `Application.mk` for arch targeting ----- cherry-pick of kivy@a8f2ca1 from kivy#3172 (minus the unit test changes, as they conflict) (plus qt6 equivalent change)
When building on debian 12, we were using Java 17. On debian 13, there is Java 21. Gradle was giving build errors with new Java: ``` Could not compile build file '/home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/dists/Electrum/build.gradle'. > startup failed: General error during conversion: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65 ``` see https://docs.gradle.org/current/userguide/compatibility.html for our p4a fork, this cherry-picks: - kivy/python-for-android@17bf532 - kivy/python-for-android#3172 kivy/python-for-android@a8f2ca1
When building on debian 12, we were using Java 17. On debian 13, there is Java 21. Gradle was giving build errors with new Java: ``` Could not compile build file '/home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/dists/Electrum/build.gradle'. > startup failed: General error during conversion: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65 ``` see https://docs.gradle.org/current/userguide/compatibility.html for our p4a fork, this cherry-picks: - kivy/python-for-android@17bf532 - kivy/python-for-android#3172 kivy/python-for-android@a8f2ca1
When building on debian 12, we were using Java 17. On debian 13, there is Java 21. Gradle was giving build errors with new Java: ``` Could not compile build file '/home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/dists/Electrum/build.gradle'. > startup failed: General error during conversion: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65 ``` see https://docs.gradle.org/current/userguide/compatibility.html for our p4a fork, this cherry-picks: - kivy/python-for-android@17bf532 - kivy/python-for-android#3172 kivy/python-for-android@a8f2ca1 --- However this still does not work yet: - contrib/android/make_barcode_scanner.sh fails, as markusfisch/zxing-cpp and markusfisch/CameraView are also using too old gradle versions for Java 21 - it they are intentionally doing this to maintain compat with Android 4: see markusfisch/zxing-cpp@d98ed5d so for now maybe the path of least resistance is to downgrade to Java 17?
When building on debian 12, we were using Java 17. On debian 13, Java 17 is not packaged anymore, instead there is Java 21 and 25. Ideally we should upgrade to Java 21 and just install it from apt. However old Gradle is not compatible with new Java, so we have to upgrade Gradle for that. - see https://docs.gradle.org/current/userguide/compatibility.html Old Gradle is giving build errors with Java 21: ``` Could not compile build file '/home/user/wspace/electrum/.buildozer_qml/android/platform/build-arm64-v8a/dists/Electrum/build.gradle'. > startup failed: General error during conversion: Unsupported class file major version 65 java.lang.IllegalArgumentException: Unsupported class file major version 65 ``` for our p4a fork, I tried to cherry-pick stuff from upstream: - kivy/python-for-android@17bf532 - kivy/python-for-android#3172 kivy/python-for-android@a8f2ca1 - see SomberNight/python-for-android@a01269f...846a109 That seems sufficient to upgrade Gradle as far as p4a is concerned. However that still did not work yet: - contrib/android/make_barcode_scanner.sh fails, as markusfisch/zxing-cpp and markusfisch/CameraView are also using too old gradle versions for Java 21 - it seems they are intentionally doing this to maintain compat with Android 4: see markusfisch/zxing-cpp@d98ed5d So for now maybe the path of least resistance is to downgrade to Java 17 :(
Already tested here and it's working fine:
On
buildozer.spec:Summary
gradle-wrapper.properties:distributionUrlnow points togradle‑8.14.3‑all.zipbuild.tmpl.gradle:'com.android.tools.build:gradle:8.1.1'to'com.android.tools.build:gradle:8.11.0'jcenter()tomavenCentral().Motivation
I tried to compile my application using
android.api = 36but started getting these logs:After some investigation:


targetSdkVersion ≥ 35; this requires AGP ≥ 8.6 and Gradle ≥ 8.13.jcenter()is deprecated; switching tomavenCentral()removes a dead dependency source.