Skip to content

jni version out of date #416

Open
Open
@Gibbz

Description

@Gibbz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions