You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(android): switch to Kivy master + p4a develop for Python 3.14
Kivy 2.3.1 ships pre-generated Cython C that calls _PyLong_AsByteArray
with 5 args. Python 3.14 added a 6th `with_exceptions` parameter, so
buildozer dies during the Cython extension compile with:
error: too few arguments to function call, expected 6, have 5
note: '_PyLong_AsByteArray' declared here (... 6 params)
The p4a project tracked this in kivy/python-for-android#3274 and shipped
the auto-resolve recipe in PR #3271; on the user side, the documented
fix is to use Kivy master (which is built with Cython >= 3.1 that emits
the new 6-arg call) plus p4a develop + API 36 + NDK r29.
Changes:
- buildozer.spec: kivy==2.3.0 -> kivy==master; android.api 34 -> 36;
android.ndk 25b -> 29; android.sdk 34 -> 36; comment block rewritten
to document the new tested combination.
- build.sh: auto-resolve ANDROIDNDK from $ANDROID_SDK_ROOT/ndk/29.*;
auto-detect buildozer in ~/venv_p4a_develop/bin first (the venv
Buildozer docs require for the Python 3.14 path); ANDROIDAPI 34 -> 36;
NDKAPI 21 -> 26; ANDROIDNDKVER 25b -> 29.
- docs/ANDROID_BUILD.md: rewrite \u00a71 (pre-flight) for the python3.14 venv
install; \u00a72 (SDK) for platform 36 / build-tools 36 / ndk r29; \u00a74
(build) to source the venv first; expanded troubleshooting table
with the _PyLong_AsByteArray entry and links to upstream issues.
Refs:
- https://buildozer.readthedocs.io/en/latest/installation/
- kivy/python-for-android#3271
- kivy/python-for-android#3274
After this, `$ANDROID_SDK_ROOT/ndk/25.1.8937393` must exist. The build script
65
-
exports `ANDROIDNDK` to that exact path.
88
+
After this, `$ANDROID_SDK_ROOT/ndk/29.*` must exist. `build.sh` auto-resolves
89
+
`ANDROIDNDK` by globbing that directory, so the exact patch version doesn't
90
+
matter — any `29.x.y` install will be picked up.
66
91
67
92
## 3. Clone and check out the fix branch
68
93
@@ -74,7 +99,11 @@ git checkout fix/android-build
74
99
75
100
## 4. Build
76
101
102
+
Activate the venv first so `buildozer` resolves to the Python 3.14 install:
103
+
77
104
```bash
105
+
source~/venv_p4a_develop/bin/activate
106
+
78
107
# Always start from a clean cache the first time after pulling toolchain changes.
79
108
./build.sh clean
80
109
@@ -278,12 +307,14 @@ the other forms are Console-only.
278
307
279
308
| Symptom | Cause | Fix |
280
309
|---------|-------|-----|
281
-
|`Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))` during `toolchain create`| NDK too new (>= 26) | Re-install NDK 25b: `sdkmanager "ndk;25.1.8937393"`|
310
+
|`_PyLong_AsByteArray ... too few arguments to function call, expected 6, have 5` while compiling Kivy/Cython | Python 3.14 changed the `_PyLong_AsByteArray` C-API; Kivy 2.3.x ships pre-generated Cython C with the old 5-arg call | Use `kivy==master` in `requirements`, `p4a.branch = develop`, `android.api = 36`, `android.ndk = 29`. Already pinned in this branch's `buildozer.spec`.|
282
311
|`Recipe with name '<long-string>' not found`| Multi-line `requirements =` in `buildozer.spec`| Keep `requirements =` on one comma-separated line |
283
312
|`Could not find ortools / faster-whisper / numpy`| Desktop-only dep in mobile requirements | Remove from `buildozer.spec`; guard import in code |
284
313
|`Gradle build failed: Unsupported class file major version 65`| Wrong JDK |`export JAVA_HOME=/usr/lib/jvm/java-17-openjdk`|
285
-
|`aidl is missing`| build-tools not installed |`sdkmanager "build-tools;34.0.0"`|
314
+
|`aidl is missing`| build-tools not installed |`sdkmanager "build-tools;36.0.0"`|
315
+
|`Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))` during `toolchain create`| Mixing p4a `master` with Python 3.14, or running NDK r25 against Python 3.14 sources | Use Python 3.14 venv + `p4a.branch = develop` + NDK r29 as documented in §1–2 |
286
316
| Build cache wedged after upgrading p4a | Stale `.buildozer/`|`./build.sh clean`|
317
+
|`buildozer not found` from `build.sh`| Venv not activated or installed elsewhere |`source ~/venv_p4a_develop/bin/activate` (see §1) |
0 commit comments