android/renderscript-samples

RenderScriptMigrationSample: target API level '29' is out of range ('11' - '24')

mariusboepple opened this issue · 4 comments

I'm getting this error when trying to install the RenderScriptMigrationSample app target API level '29' is out of range ('11' - '24')

Maybe this bug from March 2017 is related to this (but that's 4 years now, so come on...) https://issuetracker.google.com/issues/37140083

Android Studio 4.1.3

Executing tasks: [:app:assembleDebug] in project /Users/.../renderscript-samples/RenderScriptMigrationSample

> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE

> Task :app:compileDebugRenderscript FAILED
error: target API level '29' is out of range ('11' - '24')


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugRenderscript'.
> com.android.ide.common.process.ProcessException: Error while executing process /Users/.../Library/Android/sdk/build-tools/30.0.3/llvm-rs-cc with arguments {-I /Users/.../Library/Android/sdk/build-tools/30.0.3/renderscript/include/ -I /Users/.../Library/Android/sdk/build-tools/30.0.3/renderscript/clang-include/ -p /Users/.../Documents/Apps/renderscript-samples/RenderScriptMigrationSample/app/build/generated/renderscript_source_output_dir/debug/out -target-api 29 /Users/.../Documents/Apps/renderscript-samples/RenderScriptMigrationSample/app/src/main/rs/colormatrix.rs /Users/.../Documents/Apps/renderscript-samples/RenderScriptMigrationSample/app/src/main/rs/blur.rs -O 3 -o /Users/.../Documents/Apps/renderscript-samples/RenderScriptMigrationSample/app/build/generated/res/rs/debug/raw}

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 442ms
1 actionable task: 1 executed

Thanks for reporting this issue. This is because "renderscriptTargetApi" gets overridden by "minSdkVersion" and the RenderScript compiler won't accept any target API greater than 28. We will fix this issue in the next SDK release. For now, a work around is to use minSdkVersion 28.

any update for this issue ? I meet this error too

@1280149014 The fix is currently available with SDK Build Tools 31.0.0.

With #17 merged, this is resolved; please kindly double check it and reopen if the issue still exists. Thank you!