【问题标题】:Cannot get property 'compileSdkVersion' on extra properties extension as it does not exist无法在额外属性扩展上获取属性“compileSdkVersion”,因为它不存在
【发布时间】:2017-06-22 16:02:08
【问题描述】:

有人请帮帮我.... 无法在额外属性扩展上获取属性“compileSdkVersion”,因为它在 android studio 中不存在。

【问题讨论】:

  • 您可以通过复制应用级别 build.gradle 中 compileSdkVersion 的值并将其粘贴到库的 compileSdkVersion 中来消除此错误

标签: android


【解决方案1】:

转到“项目文件”视图并打开构建 gradle。

你会发现这样的东西

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

你必须添加这个定义:

ext {
    compileSdkVersion = 23
    buildToolsVersion = "23.0.1"
    targetSdkVersion = 21
}

【讨论】:

    【解决方案2】:

    我刚刚通过删除解决了这个问题

    apply plugin: 'android-reporting'

    一切正常!

    【讨论】:

      猜你喜欢
      • 2015-09-11
      • 2018-05-19
      • 2021-06-20
      • 2021-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-03
      • 2021-07-11
      相关资源
      最近更新 更多