Skip to content

Rust panic - android context was not initialized: Flutter-Rinf-Rust [ hub -> rodio -> cpal -> oboe -> ndk-context ] #530

Answered by sergey-serov
sergey-serov asked this question in Q&A
Discussion options

You must be logged in to vote

Greetings!
The answer was in front of me all this time.
On the link from my question: https://cjycode.com/flutter_rust_bridge/guides/how-to/ndk-init - I was just confused that there is code on Kotlin and thought that it's appropriate only for "flutter_rust_bridge".
Finally, it is enough just to add 3 lines:

init {
    System.loadLibrary("hub")
}

in "MainActivity.kt".
Additionally to function "JNI_OnLoad" in "hub/src/lib.rs".

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sergey-serov
Comment options

@temeddix
Comment options

@sergey-serov
Comment options

Answer selected by temeddix
@temeddix
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants