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

问题描述

我只想在我的应用程序中使用 RenderScript 的 ScriptIntrinsicBlur,我添加了 renderscript.v8.jar(在 android 支持 lib v8 中)以支持 17 个以下的 api,但它在这一行崩溃(在 api

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 Studio 使用 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:

渲染脚本.target=18renderscript.support.mode=true

在 Android Studio 中,编辑应用模块中的 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):

渲染脚本目标API 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 无法在 api <17 中加载 SupportV8 RenderScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 17:57