Android Studio 2.0 Preview 2 issue with Renderscript

夙愿已清 提交于 2019-12-06 18:52:41

问题


I updated Android Studio to 2.0 Preview 2, then I got an error Renderscript support mode is not currently supported with renderscript target 21+

I'm using renderscriptTargetApi 23


回答1:


Renderscript isn't currently supported with Target 21+ so simply change the target to API 20 and that should solve the error. So the renderscript related options in your default config section of your gradle file should like :

renderscriptTargetApi 20
renderscriptSupportModeEnabled true



回答2:


The bug related to renderscriptTargetApi has been fixed in gradle-plugin 2.1.0 and Build-Tools 23.0.3. Please try it out:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }
}


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    ...
}



回答3:


@atabouraya, This is bug in build tools. Please check your build tools version and if is lower than 23.0.3, update them. More info here: http://developer.android.com/intl/es/tools/revisions/build-tools.html in Build Tools, Revision 23.0.3 (March 2016)




回答4:


@atabouraya, There need to be change in build.gradle of your app

as suggested from android developer site.

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 19

        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true

    }
}



回答5:


Just change renderscriptTargetApi 23 to renderscriptTargetApi 20, and make sure your minSdkVersion less than 21.



来源:https://stackoverflow.com/questions/34111126/android-studio-2-0-preview-2-issue-with-renderscript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!