How to use the Renderscript Support Library with Gradle

Using Android Studio:

Add the following values to build.gradle for android gradle plugin v0.14+

android {
    ...
    defaultConfig {
        ...
        renderscriptTargetApi 19
        renderscriptSupportModeEnabled true
    }
    ...
}

For older versions of the android gradle plugin v0.13.3 and below

android {
        ...
        defaultConfig {
            ...
            renderscriptTargetApi 19
            renderscriptSupportMode true
        }
        ...
    }

Once that is done, use android.support.v8.renderscript. anywhere in your app. The library jar and binaries are included automatically.

Leave a Comment