Comments (6)
This should be fixed in 069b39e, and the example is updated.
from raylib-go.
And this is the output of what command?
from raylib-go.
Following Android build instructions in Android README example.
When building for arm
and executing ./gradlew assembleDebug
command, it gives me following error in actual Android device:
java.lang.UnsatisfiedLinkError: Unable to load native library
"/data/app/~~3eAjrD7WdwqbBWolWZ6G8w==/com.example.android-
EHfqIoxxoNrUe8SXrq_smA==/base.apk!/lib/armeabi-v7a/libexample.so": dlopen failed: cannot locate symbol
"internal_storage_path" referenced by "/data/app/~~3eAjrD7WdwqbBWolWZ6G8w==/com.example.android-
EHfqIoxxoNrUe8SXrq_smA==/base.apk!/lib/armeabi-v7a/libexample.so"...
at android.app.NativeActivity.onCreate(NativeActivity.java:178)
at android.app.Activity.performCreate(Activity.java:8508)
at android.app.Activity.performCreate(Activity.java:8472)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3786)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3951)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2405)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8152)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
As you see in the error it states dlopen failed: cannot locate symbol "internal_storage_path"
.
To find where actually this undefined symbol happens, added -z,defs
flag to compile shared library command(this flag basically throws error when it hits to an undefined symbol) like so -ldflags="-s -w -extldflags=-Wl,-z,defs,-soname,libexample.so"
and it gave me the linker error in the initial post.
CC="F:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi31-clang" \
CGO_CFLAGS="-IF:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include -IF:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/arm-linux-androideabi --sysroot=F:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot" \
CGO_LDFLAGS="-LF:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/arm-linux-androideabi/31 -LF:/Android-SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/lib" \
GOOS=android GOARCH=arm CGO_ENABLED=1 go build -buildmode=c-shared -ldflags="-s -w -extldflags=-Wl,-soname,libexample.so" \
-o=android/libs/armeabi-v7a/libexample.so
ld: error: undefined symbol: internal_storage_path
>>> referenced by platform_android.c
>>> ..\..\..\..\AppData\Local\Temp\go-link-3058170194\000014.o:(android_init)
ld: error: undefined symbol: asset_manager
>>> referenced by platform_android.c
>>> ..\..\..\..\AppData\Local\Temp\go-link-3058170194\000014.o:(android_init)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from raylib-go.
Thanks, now it is clear what and where the error is, with the first post nobody could guess. Can you try to build a shared library without stripping symbols, i.e., remove -s -w
from ldflags?
from raylib-go.
Still gives the same error.
from raylib-go.
Thank you for the quick fix!
from raylib-go.
Related Issues (20)
- [IMPORTANT] GLFW error and wrong (0,0) position HOT 11
- WASM HOT 1
- Building for Android arm64 HOT 2
- Intermittent SIGBUS: bus error When uploading a custom mesh to gpu HOT 1
- log android HOT 2
- how get jni acces? HOT 9
- cannot locate symbol "internal_storage_path" HOT 12
- Dear IMGUI support HOT 1
- 2 or 3 second build times? HOT 2
- Misleading use of color type RGBA. HOT 2
- No function for `GuiLoadIcons` HOT 1
- Cross compiling error HOT 6
- Can't debug via go-delve on M1 MacOS. (missing rodata struct member) HOT 1
- Issues with using DLL on Windows HOT 1
- Adding `SwapScreenBuffer()` and `PollInputEvents()` functions HOT 3
- Can not build for windows/darwin HOT 2
- errors with camera on fedora HOT 3
- Unable to remove status bar from raygui Panels HOT 11
- Not support win7? Is there any way to work with win7? HOT 3
- delve fails to build, can't find utils_log.h HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-go.