5

I'm building a helper library for Android apps and I need a full OpenSSL implementation for some of the support libraries I'm using. I'm creating a build chain and compiling libssl and libcrypto with it but at runtime I get:

java.lang.ExceptionInInitializerError
  Caused by: java.lang.UnsatisfiedLinkError: Cannot load library:
    soinfo_relocate(linker.cpp:975): cannot locate symbol "tcgetattr" referenced by "libcrypto.so.1.0.0"...

I'm guessing there's something I need to do to help locate tcgetattr at runtime?

jww
  • 97,681
  • 90
  • 411
  • 885
Kagetsuki
  • 309
  • 2
  • 18
  • 1
    You probably build using Android platform libraries for API 21 (Android 5.0 Lollipop), but test on a device that runs API 19 (Android 10 KitKat), or lower. – Alex Cohn Oct 19 '15 at 19:07
  • @AlexCohn You're a life saver! That was it! I'm guessing we need to build on API 19 (testing that now)? Something else? *Feel free to post an answer so I can accept it. – Kagetsuki Oct 20 '15 at 08:16

1 Answers1

5

Android runtime has significantly changed between API 19 and API 21. The NDK libraries reflect this change, and many symbols (e.g. srand) are now exported from the system libraries. Therefore is important to set APP_PLATFORM (if Android.mk is used) or platformVersion (if experimental plugin is used) not higher than the lowest SDK version that your app supports.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307