Android Studio cannot resolve symbol 'TabLayout'

出现这个问题一般是因为未引用库,解决方法如下:

1、在app/build.gradle下

 

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:your_api_version_number.0.0'//相应版本
    compile 'com.android.support:design:+'//相应版本
}

 

然后Build->Clean Project 

2、在项目根build.gradle下
ext {
    compileSdkVersion = 23
    buildToolsVersion = "23.0.1"//相应版本
    supportLibVersion = "23.0.1"//相应版本
}

然后:工具栏中sync project with gralde file

posted @ 2016-04-30 17:07  goodpan  阅读(3025)  评论(0编辑  收藏  举报