android can't load SupportV8 RenderScript in api <17

天涯浪子 提交于 2019-11-29 08:01:48
Larry Schiefer

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

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

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

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 18 renderscriptSupportModeEnabled true

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.

It's interesting, that even the Android Renderscript examples wont work in an emulator, lets say with API 10. (Tested via Android Studio, recent updates, create Example, Emulator with API 10 -> Crash). That's surprising. At my project, I did try/catch the Renderscript and take a fallback to at least do not crash the app, if the single stupid blur effect, made with Renderscript, is not available. So we know, the shared library is missing on the device. That's why some people copy the Renderscript libraries to their project, usually the build tools would do the same. One could easily check this by having a look into the apk/zip file. I think a good tutorial is given here: http://possiblemobile.com/2013/10/renderscript-for-all

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