如何解决Java实现卡视图
我正在尝试使用Android Studio在Java中导入卡片视图。我尝试了几种方法来纠正此错误,但如果有可能请帮助我,但我无法修复此错误。
我将此代码implementation 'com.android.support:cardview-v7:30.0.1'
添加到build.gradle(module:app)的依赖项中。
但是它给了我这个错误: 找不到cardview-1.0.0.jar(androidx.cardview:cardview:1.0.0)。 在以下位置搜索: https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.jar
当我从代码中删除此行时,它不再显示此错误。
我尝试用以下代码替换该代码:
implementation 'androidx.cardview:cardview:1.0.0'
但是我看到了这个错误:
无法解决:cardview-1.0.0 受影响的模块:应用
这是我的build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion '30.0.1'
defaultConfig {
applicationId "com.allamehelli3.second"
minSdkVersion 21
targetSdkVersion 30
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.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'com.android.support:recyclerview-v7:30.0.1'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.code.gson:gson:2.8.6'
}'
PS:我将此行“实现” androidx.cardview:cardview:1.0.0”更改为“实现'com.android.support:cardview-v7:30.0.1”,但我的问题没有解决。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。