GithubHelp home page GithubHelp logo

Comments (6)

gen2brain avatar gen2brain commented on June 17, 2024 1

This should be fixed in 069b39e, and the example is updated.

from raylib-go.

gen2brain avatar gen2brain commented on June 17, 2024

And this is the output of what command?

from raylib-go.

Alireza-Ta avatar Alireza-Ta commented on June 17, 2024

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.

gen2brain avatar gen2brain commented on June 17, 2024

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.

Alireza-Ta avatar Alireza-Ta commented on June 17, 2024

Still gives the same error.

from raylib-go.

Alireza-Ta avatar Alireza-Ta commented on June 17, 2024

Thank you for the quick fix!

from raylib-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.