Andrey
03/25/2024, 4:46 PMjava.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "hello" referenced by "/data/app/~~5wdEQm0yie2eojravmIojg==/kotlin.test-AITs0CaDTdEGYj6PdueKLA==/lib/arm64/libtest.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
at java.lang.Runtime.loadLibrary0(Runtime.java:998)
at java.lang.System.loadLibrary(System.java:1656)
My def file looks like this:
package = api
headers = api.h
headerFilter = api.h
staticLibraries = libapi.a
libraryPaths = staticlib
compilerOpts = -Istaticlib
linkerOpts = -Lstaticlib
libraryPaths = staticlib
Any ideas pleaseLandry Norris
03/25/2024, 6:43 PMnm -C libapi.a
and see if the symbol shows up. The paths tend to be relative to the build folder, not the project directory, so add ../ before paths. I usually specify both '../' and '../../' since I remember seeing a certain way of running tests require a different directory.Landry Norris
03/25/2024, 6:44 PMAndrey
03/25/2024, 6:45 PMAndrey
03/26/2024, 9:42 AMnm -C libapi.a | grep hello
- 0000000000000000 T hello()
nm -C libtest.so | grep hello
- U hello
This is strange because in the build folder I find KLIB files that contain libapi.aPaddy O'Brien
03/26/2024, 2:46 PMAndrey
03/26/2024, 2:47 PMI'm building a shared lib which is based on kotlin native, it includes a static library in C++
Landry Norris
03/26/2024, 2:47 PMPaddy O'Brien
03/26/2024, 2:48 PMPaddy O'Brien
03/26/2024, 2:48 PMLandry Norris
03/26/2024, 2:48 PMAndrey
03/26/2024, 2:49 PMLandry Norris
03/26/2024, 2:50 PMAndrey
03/26/2024, 2:51 PMYes, I thought so too, so I did the same thing in the usual project for android. And it just works there
Andrey
03/26/2024, 2:52 PMLandry Norris
03/26/2024, 2:53 PMAndrey
03/26/2024, 3:46 PM