android - 如何将 cardview 添加到我的 android studio 项目中?
问题描述
我已经有这个问题很长时间了。错误:无法解决:cardview 受影响的模块:app
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.self"
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
}
解决方案
添加 implementation 'com.google.android.material:material:1.1.0'
到您的依赖项
推荐阅读
- java - JDBC4 语法错误,但 MySQL 接受查询
- android - android 应用程序集成中的谷歌地图不能顺利拖动/移动
- python - 在循环中创建不同的函数 - Flask/Python
- php - 仅在专门创建的 div 中显示 php echo 输出,而不在主页中显示
- windows - Powershell - 任务栏图标,从不合并,隐藏标签,按应用 ID 分组
- google-app-engine - GAE Flex 自定义运行时随机关闭
- java - 连续随机变量表
- r - 有没有一种比较 2 个数据表的好方法,但是将 i 中的数据与第二个数据表中 i+1 的数据进行比较
- javascript - 正则表达式从字符串中提取数字和日期
- intellij-idea - 如何设置 intellij 以强制使用 VAR_NAME 格式的静态最终变量