android.support.v7.widget.toolbar类没有显示在我的任何新项目中?

时间:2016-04-06 07:28:14

标签: android android-support-library

我输入了工具栏,IntelliSense为我提供了课程参考import android.widget.Toolbar;但未显示android.support.v7.widget.toolbar

我创建了多个新项目,但仍无法正常工作。我使用android.support.v7.widget.toolbar工作正常的旧项目。

我最近从SDK管理器添加了android N软件包。可能这可能是一个原因。

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:1.5.0'

        // 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
}

Gradle App设置:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "harry.com.myapplication"
        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.2.1'
}

0 个答案:

没有答案