【问题标题】:Issue in Compiling gradle File编译 gradle 文件中的问题
【发布时间】:2016-02-10 12:58:02
【问题描述】:

这是我的build.gradle 文件

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 22
        buildToolsVersion '23.0.0 rc2'

        defaultConfig {
            applicationId "com.nanu.admin.notification"
            minSdkVersion 8
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
    }

最后两行显示错误..如何在 android studio 中解决这个问题???

【问题讨论】:

    标签: android gradle android-gradle-plugin android-support-library android-appcompat


    【解决方案1】:

    那是因为您的项目构建版本和支持版本不同,请更改支持库版本

    【讨论】:

      【解决方案2】:

      问题来了

      buildToolsVersion '23.0.0 rc2'
      

      解决方案:1

      将 builtToolsVersion 替换为 23.0.1 或 23.0.2

      解决方案:2

      替换

       compile 'com.android.support:appcompat-v7:23.1.1'
       compile 'com.android.support:design:23.1.1'
      

       compile 'com.android.support:appcompat-v7:23.0.0'
       compile 'com.android.support:design:23.0.0'
      

       compile 'com.android.support:appcompat-v7:23.0.1'
       compile 'com.android.support:design:23.0.1'
      

      【讨论】:

        【解决方案3】:

        由于您使用的是支持 libraries v23,因此您必须使用 api 23 进行编译。

        改变这一行:

          compileSdkVersion 23
        

        还将buildToolsVersion 更改为最新的稳定版本。

         buildToolsVersion '23.0.2'
        

        【讨论】:

          猜你喜欢
          • 2023-02-19
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-06-29
          • 2013-08-17
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多