Skip to content
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

jni version out of date #416

Open
Gibbz opened this issue Dec 23, 2024 · 1 comment
Open

jni version out of date #416

Gibbz opened this issue Dec 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Gibbz
Copy link

Gibbz commented Dec 23, 2024

Describe the bug
current version jni = "0.21.1"
in the library its jni = "0.19.0"
this is causing incompatability issues in my app.

Expected behavior
working with the latest version


error[E0308]: mismatched types
   --> src/android.rs:53:30
    |
53  |     btleplug::platform::init(&env).unwrap();
    |     ------------------------ ^^^^ expected `JNIEnv<'_>`, found a different `JNIEnv<'_>`
    |     |
    |     arguments to this function are incorrect
    |
    = note: `JNIEnv<'_>` and `JNIEnv<'_>` have similar names, but are actually distinct types
note: `JNIEnv<'_>` is defined in crate `jni`
   --> /home/bronson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jni-0.21.1/src/wrapper/jnienv.rs:196:1
    |
196 | pub struct JNIEnv<'local> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: `JNIEnv<'_>` is defined in crate `jni`
   --> /home/bronson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jni-0.19.0/src/wrapper/jnienv.rs:79:1
    |
79  | pub struct JNIEnv<'a> {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `jni` are being used?
note: function defined here
   --> /home/bronson/.cargo/registry/src/index.crates.io-6f17d22bba15001f/btleplug-0.11.7/src/droidplug/mod.rs:12:8
    |
12  | pub fn init(env: &JNIEnv) -> crate::Result...
    |        ^^^^

If i change the version of jni in my cargo down to the same version, i get 19 new other errors... But ive managed to downgrade the version for now and its fixed the error.

@Gibbz Gibbz added the bug Something isn't working label Dec 23, 2024
@qdot
Copy link
Contributor

qdot commented Dec 23, 2024

Yeah we've got #281 and #376 related to this, but it's gonna be a lot of work that I haven't had time for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants