【问题标题】:cannot find android support library找不到android支持库
【发布时间】:2016-07-13 01:33:42
【问题描述】:

注意我搜索了很多所以这不是一个重复的问题

搜索这些没有答案

Can't find Android Support Package

Cant' find Android Support package

How to add "Android Design Support Library" to Eclipse with ADT-plugin?

https://developer.android.com/topic/libraries/support-library/setup.html#using-apis

我只是希望能够使用 TabLayout 当我使用它时它说 无法解析“TabLayout”符号。

当我尝试导入它时

导入 android.support.design.widget.TabLayout; 说也无法解析'TabLayout'

我也搜索了那个错误,结果安装了我找不到的 android 支持库

这是一个搜索 Android Studio cannot resolve symbol 'TabLayout'

那么如何安装那个库?!!

Image of SDK

这里是 gradle.build

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "24.0.0"

defaultConfig {
    applicationId "com.example.android.engtomiwak"
    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.4.0'
}

提前谢谢....

【问题讨论】:

  • 你在gradle中添加吗?
  • 你应该在这里添加你的 build.gradle 文件。
  • 如果你的意思是在依赖项下添加 compile "com.android.support:support-v4:23.0.+" 这个,是的,我做到了,但 TabLayout 仍然无法解决
  • 你可以尝试重建项目。
  • 我在编辑中添加了 gradle @anti_gone

标签: android sdk android-support-library


【解决方案1】:

确保您已添加依赖项:

compile 'com.android.support:design:23.1.1'

然后导入:

import android.support.design.widget.TabLayout;

【讨论】:

  • 非常感谢,我之前试过了,但是问题是我在依赖项下添加编译后没有同步gradle,非常感谢
猜你喜欢
  • 2017-03-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-30
  • 2015-10-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多