Renderscript 未使用构建工具 25.0.0+ 进行编译

Renderscript not compiling with build tools 25.0.0+

更新构建工具 25.0.2 后出现以下错误(使用 23.0.2 时它工作正常):

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}

我在 app/build.gradle 中有以下内容:

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'

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

如您所见,renderscriptTargetApi 设置为 21,但新构建工具强制将其设置为 25。由于依赖于需要关闭它的库,我无法打开支持模式。

我应该恢复到构建工具 23.0.2 并等待修复,还是有任何解决方法可以让 renderscript 使用最新的构建工具?

似乎 gradle-plugin 以某种方式用 targetSdkVersion 覆盖了 renderscriptTargetApi。

我猜你可以在问题得到解决之前使用 targetSdkVersion 21

构建工具 r25 中似乎存在错误。我已经向 Android 跟踪器提交了一张票:https://code.google.com/p/android/issues/detail?id=260929&thanks=260929&ts=1490175869