java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsuppo

as更新到3.0以后,运行程序发现如下报错:

11-15 13:24:22.849 10388-10388/com.test.nginxpush E/AndroidRuntime: FATAL EXCEPTION: main
                                                                    Process: com.test.nginxpush, PID: 10388
                                                                    java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...
                                                                        at java.lang.Runtime.loadLibrary(Runtime.java:364)
                                                                        at java.lang.System.loadLibrary(System.java:526)
                                                                        at com.android.tools.profiler.support.ProfilerService.<clinit>(ProfilerService.java:41)
                                                                        at android.support.v4.app.SupportActivity.<init>(SupportActivity.java:68)
                                                                        at android.support.v4.app.BaseFragmentActivityApi14.<init>(BaseFragmentActivityApi14.java:28)
                                                                        at android.support.v4.app.BaseFragmentActivityJB.<init>(BaseFragmentActivityJB.java:34)
                                                                        at android.support.v4.app.FragmentActivity.<init>(FragmentActivity.java:75)
                                                                        at android.support.v7.app.AppCompatActivity.<init>(AppCompatActivity.java:60)
                                                                        at com.test.nginxpush.MainActivity.<init>(MainActivity.java:16)
                                                                        at java.lang.Class.newInstanceImpl(Native Method)
                                                                        at java.lang.Class.newInstance(Class.java:1208)
                                                                        at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
                                                                        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2117)
                                                                        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2249)
                                                                        at android.app.ActivityThread.access$800(ActivityThread.java:141)
                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                        at android.os.Looper.loop(Looper.java:136)
                                                                        at android.app.ActivityThread.main(ActivityThread.java:5113)
                                                                        at java.lang.reflect.Method.invokeNative(Native Method)
                                                                        at java.lang.reflect.Method.invoke(Method.java:515)
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
                                                                        at dalvik.system.NativeStart.main(Native Method)

重点在于这句:

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "strtof" referenced by "libsupportjni.so"...

之前的改变:
Android Profiler

Android Profiler requires a device with API 21 (Lollipop) or higher

引导设置如下:
Run -> EditConfigurations… -> Profiling ->Enable advanced profiling (required for API level < 26 only)

然后就发现运行的安装包增加了libsupportjni.so,在android5.0以下手机运行就会报错,5.0以上没有问题。

所以解决方案:
5.0以上最好使用推荐的设置,Profiler可以帮助更好的分析内存、网络等情况

5.0以下,就去掉Enable advanced profiling的勾选项

此外:由于勾选以后生成的so文件会在:
armeabi、armeabi-v7…等目录下,会导致找不到so文件报错,这是由于之前的so文件设置了只生成在armeabi文件下下,导致armeabli-v7等无法找到的问题,所以解决办法就是:
ndk{
abiFilters ‘armeabi’
}
这样生成的so文件只会放在armeabi一份。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值