简体   繁体   English

Gradle Build Error无法获得未知属性supportVersion

[英]Gradle Build Error Could not get unknown property supportVersion

Error Message: 错误信息:

Could not get unknown property 'supportVersion' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. 无法获得类型为org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler的对象的未知属性'supportVersion'。

Build.gradle Codes:- Build.gradle代码:-

apply plugin:'com.android.application'

android {

    compileSdkVersion 25

    buildToolsVersion '27.0.3'

    defaultConfig {

        applicationId "com.eassycars.www.dlservices"

        minSdkVersion 16

        targetSdkVersion 25

        versionCode 1

        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {

        release {

            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }

    }

}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')

// google & support

 implementation "com.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler :$supportVersion"

    implementation "com.android.support:appcompat-v7:$supportVersion"

    implementation "com.android.support:cardview-v7:$supportVersion"

    implementation "com.android.support:recyclerview-v7:$supportVersion"

    implementation "com.android.support:design:$supportVersion"

    implementation "com.android.support:palette-v7:$supportVersion"

    implementation "com.android.support:customtabs:$supportVersion"

    implementation "com.android.support:support-v4:$supportVersion"

    implementation 'com.google.android.exoplayer:exoplayer:r2.0.4'
// utils

    implementation 'com.github.bumptech.glide:glide:4.0.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'

    implementation 'com.koushikdutta.ion:ion:2.1.7'

    implementation 'com.github.Commit451:bypasses:1.0.4'

    implementation 'com.jakewharton:butterknife:8.8.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.0'

    implementation 'com.drewnoakes:metadata-extractor:2.9.1'

    implementation "com.orhanobut:hawk:2.0.1"

    classpath 'com.google.gms:google-services:3.1.1'

    compile 'com.android.support:support-annotations:27.1.1'
}

Can Anyone tell me that how to fix this error 任何人都可以告诉我如何解决此错误

The error tells that there is no value for the variable $supportVersion. 该错误表明变量$ supportVersion没有值。 If you know exactly what version you would like to use then define supportVersion like you have defined buildToolsVersion . 如果你确切地知道你想要的是什么版本使用然后定义supportVersion像你定义buildToolsVersion I am not sure but its the same for your case. 我不确定,但对于您的情况相同。

buildToolsVersion '27.0.3'
supportVersion '27.0.3'

Or replace supportVersion with buildToolsVersion in your existing file. 或更换supportVersionbuildToolsVersion在现有文件中。

you need to add above android{} on your gradle 您需要在gradle上添加android{}以上

ext {
supportVersion='27.1.1'
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法获取未知属性“运行时”Gradle 7.0 - Could not get unknown property "runtime" Gradle 7.0 无法在Gradle中获得任务的未知属性? - Could not get unknown property for task in Gradle? Gradle Build Failing: Could not get unknown property 'RunTheProgram' for object of type org.gradle.api.plugins.internal.DefaultJavaApplication - Gradle Build Failing: Could not get unknown property 'RunTheProgram' for object of type org.gradle.api.plugins.internal.DefaultJavaApplication 错误:Gradle 同步失败:无法为 DefaultConfig_Decorated 获取未知属性“API_KEY” - ERROR: Gradle sync failed: Could not get unknown property 'API_KEY' for DefaultConfig_Decorated 错误:(134, 0) 无法为 org.gradle.api.internal.FactoryNamedDomainObjectContainer 类型的 SigningConfig 容器获取未知属性“释放”。 - Error:(134, 0) Could not get unknown property 'release' for SigningConfig container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer. 无法获取类型为com.android.build.gradle.internal.api.DefaultAndroidSourceSet的源集主体的未知属性“输出” - Could not get unknown property 'output' for source set main of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet Gradle:无法在 Intellij 中设置未知属性“classDumpFile” - Gradle: could not set unknown property 'classDumpFile' in Intellij 无法在 Gradle 中设置未知属性“applicationDefaultJvmArgs” - Could not set unknown property 'applicationDefaultJvmArgs' in Gradle Android Studio:“无法获得类型为 org.gradle.api.Project 的项目的未知属性‘VERSION_NAME’” - Android Studio : “Could not get unknown property 'VERSION_NAME' for project of type org.gradle.api.Project” 无法为org.gradle.api.Project类型的根项目“MyApplication3”获取未知属性“删除” - Could not get unknown property 'Delete' for root project 'MyApplication3' of type org.gradle.api.Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM