java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "random" referenced by ... only when targeting android-21

753 views
Skip to first unread message

Martin Rajniak

unread,
Oct 29, 2014, 1:13:13 PM10/29/14
to andro...@googlegroups.com
Hey, 
I am having issues when trying to build and use native library.

I am able to build the library but when I try to load it I get a runtime error : 
  java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "random" referenced by..

I get this error only when in Application.mk I set APP_PLATFORM := android-21 and I run application on pre-21 devices (unfortunately I wasn't able to test on android-21 devices). 
Otherwise if I use android-19 for APP_PLATFORM, I don't get any errors.

Other Application.mk settings:
APP_ABI := armeabi-v7a
APP_STL := gnustl_static

NDK_TOOLCHAIN_VERSION = 4.9

I use latest NDK windows revision (r10c) to build native library. I target latest android-21 everywhere else in the application (gradle build files).

I wonder if it is a bug, a known bug, and there already is a ticket for it.

Best


Andrew Hsieh

unread,
Oct 29, 2014, 2:52:09 PM10/29/14
to andro...@googlegroups.com
Apps compiled with APP_PLATFORM:=android-21 may not run on pre-21 devices.  This is by design, because the headers/libs apps link may contain new APIs in android-21 but absent from previous release.  

Sebas V

unread,
Nov 21, 2014, 4:23:48 PM11/21/14
to andro...@googlegroups.com
Is that true in general? e.g. if the min sdk i support on the java side is 15, do i have to set APP_PLATFORM target to android-15 for my ndk code to ensure it runs on all older  devices?
so far i had it set to platform-19, and assumed it still will work on older platforms as long as i don't use anything specific to the newer NDK.

thanks,
Reply all
Reply to author
Forward
0 new messages