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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM