etan
etan

Reputation: 593

Renderscript not compiling with build tools 25.0.0+

I'm getting the following error after updating to build tools 25.0.2 (with 23.0.2 it was working just fine):

Error:target API level '25' is out of range ('11' - '24')

Error:Execution failed for task ':app:compileDevDebugRenderscript'.
> com.android.ide.common.process.ProcessException: Error while executing process /usr/local/opt/android-sdk/build-tools/25.0.2/llvm-rs-cc with arguments {-O 3 -I /usr/local/opt/android-sdk/build-tools/25.0.2/renderscript/include/ -I /usr/local/opt/android-sdk/build-tools/25.0.2/renderscript/clang-include/ -p /<redacted>/app/build/generated/source/rs/dev/debug -o /<redacted>/app/build/generated/res/rs/dev/debug/raw -target-api 25 /<redacted>/app/src/main/rs/<redacted>.rs}

I have the following in app/build.gradle:

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 25
        renderscriptTargetApi 21
        renderscriptSupportModeEnabled false
        ...
    }
    ...
}

As you can see renderscriptTargetApi is set to 21, but the new build tools forces it to be 25 regardless. I can't turn on support mode due to a dependency to a library which requires it to be turned off.

Should I just revert back to build tools 23.0.2 and wait for a fix or is there any workarounds to get renderscript to work with the latest build tools?

Upvotes: 4

Views: 3207

Answers (2)

Eugene Nefedov
Eugene Nefedov

Reputation: 480

Seems it bug in build tools r25. I've submitted a ticket to Android tracker: https://code.google.com/p/android/issues/detail?id=260929&thanks=260929&ts=1490175869

Upvotes: 7

Miao Wang
Miao Wang

Reputation: 1130

Seems that gradle-plugin somehow override renderscriptTargetApi with targetSdkVersion.

I guess you could use targetSdkVersion 21 before the issue got fixed.

Upvotes: 1

Related Questions