Android Renderscript with Gradle

為{幸葍}努か 提交于 2019-12-04 14:56:16

I don't think this is a Gradle bug--I think this is a known dynamic linking issue on Gingerbread and below. Try adding the following to your Activity:

static {
    System.loadLibrary("RSSupport");
    System.loadLibrary("rsjni");
}

you might have to reorder those, I forget the exact nature of the linking issue.

I had the same issue with Android-Studio and Renderscript support with Build-tools 21.1.0. This is what I found in build-system changelog lines 26-32:

  • Renamed a few properties to make things more consistent.
    • BuildType.runProguard -> minifyEnabled
    • BuildType.zipAlign -> zipAlignEnabled
    • BuildType.jniDebugBuild -> jniDebuggable
    • BuildType.renderscriptDebug -> renderscriptDebuggable
    • ProductFlavor.renderscriptSupportMode -> renderscriptSupportModeEnabled
    • ProductFlavor.renderscriptNdkMode -> renderscriptNdkModeEnabled

So you see, they have changed the properties name. I just updated build.gradle to use:

renderscriptSupportModeEnabled true

Now the libraries are added to the project and you don't need to manually add them to your lib folder.

Hope this helps someone and saves some time.

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