Skip to content

fix(manganis): support 32-bit Android targets in JNI callback#5641

Open
costajohnt wants to merge 1 commit into
DioxusLabs:mainfrom
costajohnt:fix/5637-armv7-android-target
Open

fix(manganis): support 32-bit Android targets in JNI callback#5641
costajohnt wants to merge 1 commit into
DioxusLabs:mainfrom
costajohnt:fix/5637-armv7-android-target

Conversation

@costajohnt

Copy link
Copy Markdown
Contributor

Building dioxus for armv7-linux-androideabi (and any 32-bit Android target) fails since #4842 because rust_callback gates compilation behind target_pointer_width = "64" with a compile_error!.

The handler pointer crosses the JNI boundary as two jlong halves. The existing reconstruction already yields a pointer-width usize: on 64-bit both halves are significant; on 32-bit the pointer fits in the low half (high half zero), so the as usize cast drops the unused high bits and recovers the original pointer. Removing the gate lets the same code compile and run on both widths, per @ealmloff's suggestion in the issue.

Verified with cargo check --target armv7-linux-androideabi -p manganis (failed before, passes after) and cargo check --target aarch64-linux-android -p manganis (unchanged). The encode side that splits the pointer into the two halves lives in plugin-provided DEX bytecode, so this preserves the existing low-half wire contract rather than changing it.

Closes #5637

The rust_callback native function gated compilation behind
target_pointer_width = "64" with a compile_error!, which broke building
dioxus for armv7-linux-androideabi (and any other 32-bit Android target)
starting with DioxusLabs#4842.

The handler pointer is transmitted across the JNI boundary as two jlong
halves. The existing reconstruction already produces a pointer-width
usize: on 64-bit both halves are significant, and on 32-bit the pointer
fits in the low half (high half zero) so the as usize cast drops the
unused high bits and yields the original pointer. Removing the gate lets
the same code compile and run correctly on both widths.

Closes DioxusLabs#5637
@costajohnt costajohnt requested a review from a team as a code owner June 20, 2026 00:15
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.

Support for the armv7-linux-androideabi target was dropped starting with Dioxus 0.7.4

1 participant