On Sat, Mar 5, 2016 at 10:42 PM, Mani Behrouz <manibehrouz2 at gmail.com> wrote: > Android M reject shared libraries which have text relocations > trying to load libopenconnect.so in Android M throws following error: > java.lang.UnsatisfiedLinkError: libopenconnect.so has text relocations > and this error stops the app to run. > but everything is ok in Android < M > I tries to somehow use PIC flag in CFLAGS but no success. > > On Sat, Mar 5, 2016 at 10:55 PM, Mani Behrouz <manibehrouz2 at gmail.com> wrote: >> Android M reject shared libraries which have text relocations >> trying to load libopenconnect.so in Android M throws following error: >> java.lang.UnsatisfiedLinkError: libopenconnect.so has text relocations >> and this error stops the app to run. >> but everything is ok in Android < M >> I tries to somehow use PIC flag in CFLAGS but no success. Are you trying to build with targetSDKVersion=23? That enables the TEXTREL check, and using <=22 disables it. I'm still building with targetSDKVersion=19, and running the app on M (AOSP 6.0.1 userdebug from MMB29K on a N5X). I guess if we want to bump it up to 23 to use the modern Java APIs, we'll need to fix the TEXTRELs in the native code first.