RenderScript支持库在x86设备上崩溃

时间:2014-03-04 02:43:32

标签: android renderscript

我正在使用x86设备Razor i上运行android.support.v8.renderscript.*的FATAL EXCEPTION。如果我使用android.renderscript.*,问题就会消失。此外,ARM设备也没有问题。这是一个例外:

03-03 18:35:26.009  25011-25011/com.example.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: android.support.v8.renderscript.RSRuntimeException: Error loading RS jni library: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]:   143 cannot locate '__strlen_chk'...
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2115)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2153)
            at android.app.ActivityThread.access$700(ActivityThread.java:137)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5031)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.support.v8.renderscript.RSRuntimeException: Error loading RS jni library: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]:   143 cannot locate '__strlen_chk'...
            at android.support.v8.renderscript.RenderScript.create(RenderScript.java:945)
            at android.support.v8.renderscript.RenderScript.create(RenderScript.java:982)
            at android.support.v8.renderscript.RenderScript.create(RenderScript.java:968)
            at com.example.app.MainActivity$PlaceholderFragment.createScript(MainActivity.java:92)
            at com.example.app.MainActivity$PlaceholderFragment.onCreateView(MainActivity.java:81)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:829)
            at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1035)
            at android.app.BackStackRecord.run(BackStackRecord.java:635)
            at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1397)
            at android.app.Activity.performStart(Activity.java:5067)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2088)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2153)
            at android.app.ActivityThread.access$700(ActivityThread.java:137)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5031)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
            at dalvik.system.NativeStart.main(Native Method)

3 个答案:

答案 0 :(得分:9)

当我使用Build Tools 21.1.1和proguard时遇到同样的问题,您可能需要使用以下proguard设置:

-keepclasseswithmembernames class * {
    native <methods>;
}
-keep class android.support.v8.renderscript.** { *; }

了解更多信息:Using the Android Renderscript v8 Support Library

答案 1 :(得分:5)

使用Build Tools 21.1.1,此问题将消失。

答案 2 :(得分:3)

我认为您还应该包含来自\ build-tools \ 19.0.2 \ renderscript \ lib \ packaged

的本机库