未能在渐变中添加依赖项



我正在学习用Java构建android应用程序,我想在我的android项目中实现tinder刷卡。我在找到CardStackViewhttps://github.com/yuyakaido/CardStackView我想使用它。但我不能在我的build.gradle中添加依赖项。这是我的build.gradle文件:

plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.appname"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'com.google.android.material:material:1.6.0-alpha03'
implementation 'com.google.android.gms:play-services-base:18.0.1'
implementation 'com.github.Cutta:GifView:1.4'
implementation 'com.google.firebase:firebase-database:20.0.4'
implementation 'com.google.firebase:firebase-auth:21.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.4.1'
implementation 'androidx.navigation:navigation-ui:2.4.1'
implementation 'com.yuyakaido.android:card-stack-view:2.3.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

这是我经常收到的错误信息:

Could not find com.yuyakaido.android:card-stack-view:2.3.4.
Required by:
project :app

我试着使用双引号,清理和重建项目,以及重新启动我的android工作室。但是我不能解决这个问题。我是不是错过了什么?提前谢谢。

此库使用JCenter。但是JCenter已被弃用,因此它不会出现在你的grade.build中。请将JCenter添加到你的gradle.build.

或者使用JitPack存储库。请参阅此处

最新更新