Closed MarcoPolo closed 4 years ago
Ooof, yep, looks like codegen for all instance fields is currently broken.
I'm going to try to publish 0.0.10 for https://github.com/MaulingMonkey/jni-bindgen/commit/7b8d3cd81ebf2c873cc09446d7b9ae63c4cde616.
I should note I'm seriously considering trying to eliminate the jni-android-sys crate completely in favor of procedural macros that generate only the necessary code, per-caller. The current approach scales very poorly.
(Also, I obviously need better testing coverage - still trying to figure out how to read AdoptOpenJDK 13 class information...)
Good news: 0.0.10 is published, and might even work! It at least compiles. Bad news: docs.rs failed to build on account of sandbox limits. Tracking upstream at https://github.com/rust-lang/docs.rs/issues/566
Let me know if this works for you so I can close this 👍
Works for me! thanks!
I was trying to get
.density
fromDisplayMetrics
and ran into a JNI error. Looking at the generated code: https://docs.rs/jni-android-sys/0.0.9/src/jni_android_sys/generated/api-level-28/android/util/DisplayMetrics.rs.html#159 I don't see how it would work. It's not using the jobject to get the field.Shouldn't the jobject be used somehow? This is an instance variable, not a static one.