I am trying to import card view in java with android studio. I had tried several ways to fix this error but I couldn't fix this error if it's possible for you please help me.
i add this code implementation 'com.android.support:cardview-v7:30.0.1'
in dependencies in build.gradle(module:app).
but it gave me this error : Could not find cardview-1.0.0.jar (androidx.cardview:cardview:1.0.0). Searched in the following locations: https://dl.google.com/dl/android/maven2/androidx/cardview/cardview/1.0.0/cardview-1.0.0.jar
and when I remove this line from my code, it doesn't show me this error anymore.
i try yo replace that code with this code:
implementation 'androidx.cardview:cardview:1.0.0'
but I saw this error:
Failed to resolve: cardview-1.0.0 Affected Modules: app
and this is my 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'
}'
P.S: i change this line 'implementation 'androidx.cardview:cardview:1.0.0'' to 'implementation 'com.android.support:cardview-v7:30.0.1'' but my problem didn't solve.