RenderScript - arm64-v8a设备无法加载任何生成的ScriptC文件,找不到“libRSSupportIO.so”

时间:2017-05-22 03:31:03

标签: android renderscript

我有三星Galaxy S7,我想在其中使用RenderScript库。所述库使用RenderScript的支持版本,并在RenderScript.forceCompat()之前加上RenderScript.create()行。

应用程序的gradle文件在依赖项块中也有这些行:

defaultConfig { renderscriptTargetApi 21 renderscriptSupportModeEnabled true renderscriptSupportModeBlasEnabled true }

ABI分裂包含arm64-v8a ABI的分割。

当库尝试初始化ScriptC文件时,会产生以下堆栈跟踪:

05-22 10:23:34.600 7568-7633/com.picmix.mobile V/RenderScript_jni: RS compat mode 05-22 10:23:34.608 7568-7633/com.picmix.mobile V/RenderScript_jni: Unable to load libRSSupportIO.so, USAGE_IO not supported 05-22 10:23:34.615 7568-7942/com.picmix.mobile E/RenderScript: Couldn't load libRSSupportIO.so 05-22 10:23:34.633 7568-7942/com.picmix.mobile E/RenderScript: Unable to open shared library (/data/app/com.picmix.mobile-1/lib/arm64/librs.img2alloc.so): dlopen failed: library "libRSSupportIO.so" not found 05-22 10:23:34.633 7568-7942/com.picmix.mobile E/RenderScript: Unable to open system shared library (/system/lib/librs.img2alloc.so): (null)

显然,这只发生在使用armv8l架构的S6和S7设备中。我在其他设备(Oppo A37,华为ALE-L21和三星Galaxy J2)上进行了测试,它在那里工作得很好 - 所有这些都低于API 23,而Oppo和S6都有“aarch64”架构。

我错过了什么吗?我是否必须手动添加libRSSupportIO.so?因为当我查看我的APK的libs文件夹时,我在那里看到了libRSSupport.so

编辑:我的构建工具版本是25.0.3。

编辑2:如果下面的堆栈跟踪是相关的,那么这是应用程序崩溃后的SIGSEGV。

05-23 09:23:18.815 21603-21603/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 05-23 09:23:18.815 21603-21603/? A/DEBUG: Build fingerprint: 'samsung/zerofltexx/zeroflte:7.0/NRD90M/G920FXXU5EQCK:user/release-keys' 05-23 09:23:18.815 21603-21603/? A/DEBUG: Revision: '11' 05-23 09:23:18.815 21603-21603/? A/DEBUG: ABI: 'arm64' 05-23 09:23:18.815 21603-21603/? A/DEBUG: pid: 19971, tid: 21568, name: AsyncTask #6 >>> com.picmix.mobile <<< 05-23 09:23:18.815 21603-21603/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c 05-23 09:23:18.815 21603-21603/? A/DEBUG: x0 0000000000000000 x1 0000000000000000 x2 0000000000000008 x3 0000000000000100 05-23 09:23:18.815 21603-21603/? A/DEBUG: x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 0000000000000000 05-23 09:23:18.815 21603-21603/? A/DEBUG: x8 0000000000000000 x9 0000007e1b7f4020 x10 0000000000000000 x11 0000000000000000 05-23 09:23:18.815 21603-21603/? A/DEBUG: x12 0000000000000018 x13 0000000000000000 x14 0000000000000000 x15 000f2561f7049c9e 05-23 09:23:18.815 21603-21603/? A/DEBUG: x16 0000007e1b7f2520 x17 0000007e1b71b344 x18 00000000ffffffff x19 0000000000000000 05-23 09:23:18.815 21603-21603/? A/DEBUG: x20 0000000000000000 x21 0000007e1d0d03c0 x22 0000007e1b3feaf0 x23 0000007e1d0d03f0 05-23 09:23:18.815 21603-21603/? A/DEBUG: x24 0000000000000001 x25 00000000ffffffff x26 0000000000000000 x27 0000000000000008 05-23 09:23:18.815 21603-21603/? A/DEBUG: x28 0000007e1b7c4798 x29 0000007e1b3feac0 x30 0000007e1b722bac 05-23 09:23:18.815 21603-21603/? A/DEBUG: sp 0000007e1b3feab0 pc 0000007e1b71b358 pstate 0000000060000000 05-23 09:23:18.823 21603-21603/? A/DEBUG: backtrace: 05-23 09:23:18.823 21603-21603/? A/DEBUG: #00 pc 0000000000068358 /data/app/com.picmix.mobile-2/base.apk (offset 0x215e000) 05-23 09:23:18.823 21603-21603/? A/DEBUG: #01 pc 000000000006fba8 /data/app/com.picmix.mobile-2/base.apk (offset 0x215e000) 05-23 09:23:18.824 21603-21603/? A/DEBUG: #02 pc 0000000000063bbc /data/app/com.picmix.mobile-2/base.apk (offset 0x215e000) 05-23 09:23:18.824 21603-21603/? A/DEBUG: #03 pc 0000000000068258 /system/lib64/libc.so (_ZL15__pthread_startPv+196) 05-23 09:23:18.824 21603-21603/? A/DEBUG: #04 pc 000000000001dc00 /system/lib64/libc.so (__start_thread+16)

1 个答案:

答案 0 :(得分:1)

libRSSupportIO.so是一个可选组件,您可以忽略有关它的消息。

我相信真正的原因是找不到librs.img2alloc.so。如果你的设备上有librs.img2alloc.so,你可以仔细检查吗?