RenderScript Support Library crashes on x86 devices

非 Y 不嫁゛ 提交于 2020-01-13 10:36:08

问题


I'm getting FATAL EXCEPTION running android.support.v8.renderscript.* on Razor i, a x86 device. The problem goes away if I use android.renderscript.* Also there is not problem with ARM devices. Here is the exception:

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)

回答1:


I meet the same issue when I using Build Tools 21.1.1 and proguard, you may need to use the following proguard settings:

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

For more infomation: Using the Android Renderscript v8 Support Library




回答2:


With Build Tools 21.1.1 this issue disappear.




回答3:


I think you should also include the native libraries from \build-tools\19.0.2\renderscript\lib\packaged



来源:https://stackoverflow.com/questions/22161832/renderscript-support-library-crashes-on-x86-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!