错误内容:

Detected problems with app nativelibraries
(please consult log for detail):
libxxx.so: text relocations
  • 解决办法一

修改targetSdkVersion<23。可是已经小于23了。

  • 解决办法二:配置Android.mk

    LOCAL_LDFLAGS += -fPIC

  • 解决办法三:configure

configure CFLAGS=-fPIC

  • 检查so办法

readelf -a path/to/yourlib.so | grep TEXTREL

如果上边的shell命令输出类似下面的内容,则说明这该so文件不是PIC,是有text relocations问题的。

0x00000016 (TEXTREL)                    0x0

 

https://stackoverflow.com/questions/39957435/text-relocations-despite-fpic

https://github.com/DoubangoTelecom/doubango/issues/486