I'm building a Renderscript processing and for the life of me I can't make it work on gingerbread through Gradle.
The processing uses both Intrinsics and custom Kernels.
using renderscriptTargetApi 18
and renderscriptSupportMode true
with the latest build tools buildToolsVersion "19.0.1"
and classpath 'com.android.tools.build:gradle:0.8.+'
and gradle 1.10 it compiles fine and it runs fine on ICS+ devices, but it crashes on Gingerbread with the following stack trace:
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)
I've also tried with a variety of the following versions:
buildToolsVersion
: 18.1.1, 18.1
classpath
: 0.7.+, 0.7.1
some of those needed gradle 1.9 to run, which I changed and run and crash.
I've also tried including the following lines in my build.gradle
dependencies {
compile files('libs/renderscript-v8.jar')
}
android {
tasks.withType(com.android.build.gradle.tasks.PackageApplication) {
pkgTask -> pkgTask.jniFolders = new HashSet<File>();
pkgTask.jniFolders.add(new File(projectDir, 'libs'));
}
}
and add all the relevant binaries as per this question How to use the Renderscript Support Library with Gradle and sometimes (depending on which versions I'm trying) it compiles and crashes with the same error, or doesn't compile because of duplicate declaration of method names on the renderscript v8 package (multiple dex files define android/support/v8/renderscript/Allocations
)
just for reference that's my module build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 18
buildToolsVersion "19.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 18
versionCode 1
versionName "1.0"
renderscriptTargetApi 18
renderscriptSupportMode true
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
}
and that's the top level build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
so the question:
What is the correct combination to make it compile successfully and run on both ICS+ and Gingerbread?