【发布时间】:2018-03-07 18:33:08
【问题描述】:
我一直在努力让 RenderScript 在我的应用上运行,TargetSDKVersion 26 和 minSDKVersion 21 在 Gradle Sync 中出现错误:
错误:任务 ':app:compileDebugRenderscript' 执行失败。 com.android.ide.common.process.ProcessException:使用参数 {-O 3 -I /home/ 执行进程 /home/mail929/.android/sdk/build-tools/26.0.2/llvm-rs-cc 时出错mail929/.android/sdk/build-tools/26.0.2/renderscript/include/ -I /home/mail929/.android/sdk/build-tools/26.0.2/renderscript/clang-include/ -p /home/ mail929/Code/Android/SmartME/app/build/generated/source/rs/debug -o /home/mail929/Code/Android/SmartME/app/build/generated/res/rs/debug/raw -target-api 21 /home/mail929/Code/Android/SmartME/app/src/main/rs/combine.rs}
最后我注意到documentation page的底部:
图形函数和类型
RenderScript 的图形子系统在 API 级别 23 中被移除。
这是否意味着我根本无法使用 RenderScript?如果有,有什么好的选择吗?
这是我完整的 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "edu.marquette.mcw.smartme"
minSdkVersion 21
targetSdkVersion 26
versionCode 4
versionName "2rc1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
renderscriptTargetApi 18
renderscriptSupportModeEnabled false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
testCompile 'junit:junit:4.12'
}
【问题讨论】:
标签: android renderscript