0

I have a problem when compiling JNI. It returns the error message like that "arm-eabi/bin/ld: cannot find -landroid_runtime". I think libandroid_runtime.so is the android's own lib. Why ld can't find the lib. Can somebody help me. My develop environment as follow: OS: Ubuntu 9.10 SDK: Android2.2 NDK: r4b

1
  • what is your ndk project layout and configuration, such as Android.mk? Can you build the hello-jni sample ?
    – qrtt1
    Oct 3, 2010 at 2:37

2 Answers 2

1

libandroid_runtime.so is in fact one of the Android system libraries, and as such is not available for NDK apps.

Check the file docs/STABLE-APIS.txt for a list of supported libraries, or even better, check the folder build/platforms/android-#/arch-arm/usr/lib where # is the Android platform level, for the definitive list of libraries you can link against.

As they say on the NDK lists, even if you manage to link against one of the other Android libraries, it likely won't work on some (or possibly even most) phones, even if it works on the one you're testing.

2
  • thanks! I had solved the problem, libandroid_runtime.so can be found in AVD /system/lib
    – Mr.ZYLiang
    Dec 18, 2010 at 2:51
  • 1
    No, you didn't solve the problem. You postponed the problem. When you use a header or library that doesn't come with the NDK, you're depending on functionality that may change in future versions of Android--and that means that your app will probably break someday without warning. Please don't do this to yourself. Aug 16, 2011 at 17:45
1

To solve your problem build a emulation of every android possible and recompile a version for each android and put it on the market with specific compatibility.

EDIT: Try using: adb pull /system/lib
EDIT 2: There also should be a egl folder in /lib so you know to look for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.