Skip to content

recipe: pyjnius 1.9.0 - #132

Merged
ndonkoHenri merged 3 commits into
flet-dev:mainfrom
ndonkoHenri:pyjnius-bump
Nov 5, 2026
Merged

ndonkoHenri merged 3 commits into
flet-dev:mainfrom
ndonkoHenri:pyjnius-bump

Conversation

@ndonkoHenri

Copy link
Copy Markdown

What

Bumps pyjnius from 1.7.0 to 1.9.0 and fixes its test.

Why

Upstream's 1.9.0 Android wheels (cp313, cp314; arm64, x86_64) outrank our 1.7.0, so unpinned apps get them, and they don't work with Flet:

  • API 28: no JNIEnv, because Flet has no SDL and JNI_GetCreatedJavaVMs isn't reachable below API 31.
  • API 34: framework classes work, but app classes raise ClassNotFoundException, including MAIN_ACTIVITY_HOST_CLASS_NAME.

Our recipe test skipped on import failure, which hid the problem.

Changes

  • Reworked mobile.patch for 1.9.0, keeping libpyjni for the JNIEnv and class loading.
  • Removed the Cython <3.1 pin; 1.9.0 declares its own range.
  • A failed import now fails the test, and a new test loads the app's own activity host class.
  • Added a catalogue entry for GNU patch rejecting LF hunks on CRLF sources.

Validation

Android only: 2/2 tests pass on Python 3.12, 3.13 and 3.14, on x86_64 emulators at API 28 and API 34. arm64 and v7a wheels were built but not run. PythonJavaClass is untested.

Consumer notes

Native Android API access through pyjnius works again for unpinned apps on Python 3.13 and 3.14. This recipe has no README yet, so there is nothing to link.

Upstream's 1.9.0 wheel outranks our 1.7.0 on cp313/cp314 and cannot find a
JNIEnv on Flet. The test now fails on import errors and also loads an app class.
GNU patch rejected the hunk: jnius_jvm_android.pxi has CRLF endings.
@ndonkoHenri
ndonkoHenri merged commit d2cb18b into flet-dev:main Nov 5, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant