I have an Android app with minSdkVersion.apiLevel
set to 18 targetSdkVersion.apiLevel
set to 23. Accordingly I set the NDK platformVersion
to 18.
Unfortunately after adding OpenSSL to the mix, the JNI library now fails to link:
/Users/pol/Downloads/Cross/External/Android-Libraries/openssl-1.0.2g/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'signal'
/Users/pol/Downloads/Cross/External/Android-Libraries/openssl-1.0.2g/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
/Users/pol/Downloads/Cross/External/Android-Libraries/openssl-1.0.2g/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function read_string_inner: error: undefined reference to 'tcsetattr'
/Users/pol/Downloads/Cross/External/Android-Libraries/openssl-1.0.2g/lib/libcrypto.a(ui_openssl.o):ui_openssl.c:function open_console: error: undefined reference to 'tcgetattr'
The problem goes away if setting platformVersion
to 21 (it doesn't work either at 19).
What does this mean for the Android app if it has an API level of 18 but the JNI library was linked for 21? Will it crash at launch on a device running 4.3?
I cannot imagine the signal
symbol be missing from 4.3 though. Is this an NDK bug?
This is exactly what will happen to your shared library when you install it on android-20 or earlier: it will fail to load. You should not be surprised that signal
was missing: Android runtime was never intended to run command-line tools like curl.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With