本文介绍了Android无法加载SupportV8 RenderScript在API< 17的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想用RenderScript的ScriptIntrinsicBlur在我的应用程序,我添加renderscript.v8.jar(以支持Android LIB V8)根据17 API的支持,但它崩溃这一行(API< 17发生这种情况在4.2或更高版本)工作正常:

i just want to use RenderScript's ScriptIntrinsicBlur in my application , i've added renderscript.v8.jar (in android support lib v8) for supporting under 17 apis but it crashes on this line (in api <17 this happens it works fine on 4.2 or higher) :

        RenderScript rs = RenderScript.create(getApplicationContext());

和异常输出

 java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:299)
        at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
        at java.util.concurrent.FutureTask.run(FutureTask.java:137)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
        at java.lang.Thread.run(Thread.java:856)
 Caused by: android.support.v8.renderscript.RSRuntimeException: Error loading RS jni library: java.lang.UnsatisfiedLinkError: Couldn't load RSSupport: findLibrary returned null
        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)

任何人有任何想法我怎么处理呢?

anyone has any idea how can i handle this ?

推荐答案

你需要告诉Eclipse或Android工作室使用RenderScript支持模式。

You'll need to tell Eclipse or Android Studio to use RenderScript support mode.

在Eclipse中,编辑 project.properties 文件,并添加:

In Eclipse, edit your project.properties file and add:

renderscript.target = 18renderscript.support.mode =真

renderscript.target=18renderscript.support.mode=true

在Android的工作室,修改 build.gradle 文件在您的应用程序模块,并在 defaultConfig 机箱添加此(见 http://developer.android.com/guide/topics /renderscript/compute.html#ide-setup 了解详细信息):

In Android Studio, edit your build.gradle file in your app module and add this in the defaultConfig enclosure (see http://developer.android.com/guide/topics/renderscript/compute.html#ide-setup for details):

renderscriptTargetApi 18renderscriptSupportModeEnabled真

renderscriptTargetApi 18renderscriptSupportModeEnabled true

目标API级别,需要有最大可以使用。如果您的最低SDK水平越高,这个值被忽略,而最小的SDK值来代替。

The target API level there needs to be the max you can use. If your minimum SDK level is higher, this value is ignored and the min SDK value is used instead.

这篇关于Android无法加载SupportV8 RenderScript在API&LT; 17的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 09:03