1

I am building the app available at https://github.com/thibautd/android-serialport-api/tree/master/android-serialport-api/project using Android NDK. What have I done until now:

  1. Build the project using gradle version 'com.android.tools.build:gradle-experimental:0.7.0-alpha1'
  2. I am building this on android-17 and running on Android device with 4.2. I have also tried android-19
  3. Build goes through without any errors but at runtime I get the exception Cannot load library: soinfo_relocate: cannot locate symbol "tcgetattr"

I have tried several options to get this working but all of them fail Options I have tried

  1. Setting APP-PLATFORM like mentioned in Cannot locate symbol 'tcgetattr' referenced by "libcrypto.so"
  2. Using $(PREBUILT_SHARED_LIBRARY) by including the .so file avialable in the same github location as mentioned in How can i Link prebuilt shared Library to Android NDK project?
  3. Tried setting LOCAL_EXPORT_C_INCLUDES in both option 1) and 2) above as mentioned in the same post How can i Link prebuilt shared Library to Android NDK project?
  4. Also tried option mentioned at Cannot load library: reloc_library[1285]: cannot locate 'rand'
  5. Put all the required include files directly in the project under /jni and tried building the project.

My project compiles absolutely fine. When testing I have always deleted the contents in build folder and rebuilt the project. To make sure the .so files are indeed created properly. In all the cases I end up in exactly the same error soinfo_relocate: cannot locate symbol "tcgetattr"

I think it is because of the fact that some of the includes like unistd.h are not correctly referenced in runtime but I am not able to figure out how to get this working.

Community
  • 1
  • 1
Sabarish
  • 11
  • 1

0 Answers0