AppCompatActivity Gradle错误

时间:2016-03-30 14:31:52

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

我尝试通过更改ActionBarActivity中的AppCompatActivity来修改应用 我还更改了build.gradle文件,附上修改后的版本。

现在,当我尝试运行程序时,我收到一条错误消息:

enter image description here

如何运行程序?

********** build.gradle *********

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"

defaultConfig {
    applicationId "it.giocoparole.trovanagramma"
    minSdkVersion 10
    targetSdkVersion 23
    versionCode 3
    versionName "0.9.2"
}

signingConfigs {
    release {
        storeFile file("C:\\AndroidStudioKeystore\\TrovAnagramma.jks")
        storePassword "xxxxx"
        keyAlias "Alias_TrovAnagramma"
        keyPassword "xxxxx"
    }
}

buildTypes {
    release {
        signingConfig signingConfigs.release


        minifyEnabled true
        zipAlignEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
    }
    debug {
        zipAlignEnabled true
        minifyEnabled false
    }
}
}

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

compile 'com.google.android.gms:play-services:6.+'

compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}

1 个答案:

答案 0 :(得分:0)

您无法使用此组合:

compileSdkVersion 21
com.android.support:appcompat-v7:23.x.x

您必须使用相同的版本进行编译。然后你可以使用:

最佳选择:

compileSdkVersion 23
com.android.support:appcompat-v7:23.x.x

compileSdkVersion 21
com.android.support:appcompat-v7:21.x.x