Skip to content

Add missing JNI variant conversion for generic Array #108019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

limbonaut
Copy link
Contributor

This PR fixes JNI abstractions not performing variant conversion for basic Array.

The issue is described in detail here:

In short, in the sentry-godot extension, we are passing Dictionary arguments to Android Plugin methods, and any basic arrays in a Dictionary are getting lost in the process. This PR fixes the issue by adding the conversion path for Variant::ARRAY in the _variant_to_jvalue() function inside jni_utils.cpp.

Before this PR

Screenshot 2025-06-26 at 16 34 22

After this PR

Screenshot 2025-06-26 at 16 34 12

@limbonaut limbonaut requested a review from a team as a code owner June 26, 2025 17:32
@limbonaut limbonaut changed the title Add JNI variant conversion for generic Array Add missing JNI variant conversion for generic Array Jun 26, 2025
@dsnopek dsnopek added this to the 4.5 milestone Jun 26, 2025
Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

The code looks good to me, and fixes the issue in my testing :-)

@syntaxerror247 syntaxerror247 added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Jun 27, 2025
@Repiteo Repiteo merged commit 72ab203 into godotengine:master Jun 27, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 27, 2025

Thanks!

@Repiteo Repiteo linked an issue Jun 27, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release platform:android topic:porting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing generic Array into the Android runtime fails without error
6 participants