Why is NDK generating shared library for x86 with

2019-06-22 07:04发布

问题:

I'm using PJSIP/PJSUA2 with Android project. I've built libpjsua2.so shared library for armeabi, armeabi-v7 and x86 with -fPIC flag. The libs are also linked with OpenSSL 1.0.2h statically which were built with -fPIC flag. All libs loads properly on device with Android 4.4 to 6.0 except x86 in which it shows text relocation error. Build script builds two versions of the lib-

android-9 (for API level upto 15 and no x86) android-16 (for API level 16+)

Why on x86, text relocation is occurring even with -fPIC flag?

回答1:

Today, I got the same error messages when testing my app with Android 7.0 on a Nexus 5 Emulator. I solved my issue by changing the targetSDKVersion to 22.

This is just a short term workaround..