请帮助:导入 android.support.design.widget.TabLayout 时出错它说无法解析符号'design'
Please help: I got error when import android.support.design.widget.TabLayout
It say "can not resolve symbol 'design'
我的 build.gradle:
My build.gradle:
compileSdkVersion 26
buildToolsVersion "26.0.0"
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26'
testCompile 'junit:junit:4.12'
}
您忘记添加设计支持库.只需在您的 gradle app 文件中添加此依赖项:
You forgot to add design support library. Just add this dependencies in your gradle app file:
implementation 'com.android.support:design:26.0.+'
设计支持库一个>
Design 包提供 API 以支持向您的应用添加材料设计组件和模式.
The Design package provides APIs to support adding material design components and patterns to your apps.
Design Support 库增加了对各种材料设计组件和模式的支持,供应用开发者构建,例如 navigation drawers、floating action buttons (FAB)、snackbars 和 TabLayout.
The Design Support library adds support for various material design components and patterns for app developers to build upon, such as navigation drawers, floating action buttons (FAB), snackbars, and TabLayout.
或AndroidX依赖:
Or AndroidX dependency:
implementation "com.google.android.material:material:1.0.0"
这篇关于错误无法解析符号 TabLayout 和“设计"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)