-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/mobile: build doesn't include libc++_shared.so to produced .apk and app immediately crashes upon start #44897
Comments
/cc @hyangah @eliasnaur |
This may be a gomobile bug, but it's probably better to bring it up with the inkyblackness/imgui-go developers to see whether they support Android. And if so, how. |
inkyblackness/imgui-go doesn't explicitly support Android. It's a pure Dear ImGui bindings library, with no platform or backend layer (there's a separate repository with glfw/sdl and opengl2/3 examples: https://github.com/inkyblackness/imgui-go-examples). |
I run into the same issue when using a C++ file with gomobile-build. Modifying a gradle file might solve this (https://stackoverflow.com/questions/39620739/android-studio-cmake-shared-library-missing-libc-shared-so-can-cmake-bundle) but this is impossible in gomobile anyway so far. |
Adding |
Where and how?
|
I added it in a Go file like
|
Compiles and doesn't crash anymore. Thanks. |
No idea why
This worked for me however. Thank you! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was trying basic gomobile example (golang.org/x/mobile/example/basic copied to my own module) by running: "gomobile install basic" and it produced basic.apk and it ran fine on a real device.
Then to the same basic example main.go file, I added only a single CGO library import: _ "github.com/inkyblackness/imgui-go/v4" to see if it compiles and works. It compiled without any errors and app installed to the real device, but when running it, it immediately crashed.
To see what error's this crash produced, I ran
adb logcat --buffer=crash
and heres the output:It seems like libc++_shared.so library is missing. I tried to search how I can include this with gomobile or some other way, but failed.
Is it possible to add/link this library or I'm doing something wrong and culprit is somewhere else? Thanks.
The text was updated successfully, but these errors were encountered: