You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I copied the bind/hello example and tried to bind a go package named go_demo with android app. But once I called the native method greetings, the app crashed. I checked the logcat, here is the reason
No implementation found for java.lang.String go_demo.Go_demo.greetings(java.lang.String) (tried Java_go_1demo_Go_1demo_greetings and Java_go_1demo_Go_1demo_greetings__Ljava_lang_String_2)"
So I opened the libgojni.so library to check the compiled function name, and it's Java_go_1demo_Go_1demo__1init and Java_go_1demo_Go_demo_greetings. So I guess the generated jni function name is wrong for go package name having underscore in it. But the init function is correct.
The text was updated successfully, but these errors were encountered:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 darwin/amd64
gomobile version +6c7f9ea Thu Sep 13 07:56:01 2018 +0000 (android,ios); androidSDK=
Does this issue reproduce with the latest release?
The gomobile version is the latest
What operating system and processor architecture are you using (
go env
)?GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
I copied the bind/hello example and tried to bind a go package named go_demo with android app. But once I called the native method greetings, the app crashed. I checked the logcat, here is the reason
No implementation found for java.lang.String go_demo.Go_demo.greetings(java.lang.String) (tried Java_go_1demo_Go_1demo_greetings and Java_go_1demo_Go_1demo_greetings__Ljava_lang_String_2)"
So I opened the libgojni.so library to check the compiled function name, and it's Java_go_1demo_Go_1demo__1init and Java_go_1demo_Go_demo_greetings. So I guess the generated jni function name is wrong for go package name having underscore in it. But the init function is correct.
The text was updated successfully, but these errors were encountered: