错误二进制XML文件行#36:错误膨胀类android.support.v7.widget.Toolbar

时间:2016-05-18 13:47:31

标签: android

我在执行新的Android Studio项目时收到:二进制XML文件行#36:错误膨胀类android.support.v7.widget.Toolbar

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

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

}

// 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:1.2.3'

        // 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
}
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.davidontalba.app2"
        minSdkVersion 15
        targetSdkVersion 23
        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'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.android.support:support-annotations:23.1.1'
}

帮助!我不能在Android Studio中做一些proyect,我不明白为什么......

1 个答案:

答案 0 :(得分:0)

将项目的build.gradle中的类路径更改为classpath 'com.android.tools.build:gradle:1.5.0'。使用 gradle 1.5或更高版本,最好是com.android.tools.build:gradle:2.0.0。那固定了我的。