Would anyone know why this is failing to import the c++_shared. System.loadLibrary("") Īnd my Application.mk has this: NDK_TOOLCHAIN_VERSION:=4.8
#ANDROID NDK RAND APK#
If you need Android-21 then Google actually recommends shipping multiple APK files. The recommended fix is to downgrade your API in jni/Application.mk and set it to something lower than Android-21. : dlopen failed: cannot locate symbol "rand" referenced by The real error is something else: rand() is not present, because of Android-21 incompatibilities.
#ANDROID NDK RAND CODE#
Unfortunately you did not provide the code where you are using rand (maybe it's even non Standard Library rand, but some custom code?), but you can still try: It should work theoretically on desktop Linux or OSX, but there are still portability issues and some quirks persist on Android, depending on NDK version, target, and some "random" factors.
you should correctly link C++ Standard Library to your. You should resolve all the symbols on the native side, i.e. Especially, C++ standard library (it has no any symbols easily and reliably accessible by JNI). You cannot make two native libraries go along this way.
These are have similar functions which exist in NDK, and You can easily implement them. Java has no any clue on what's happening past the JNI boundary. to android-ndk I guess 'POSIX.1-2008 marks randr () as obsolete.' is a reason why they removed these.