在我的專案中,我正在嘗試構建使用 SliderView 庫的自動影像滑塊視圖。我添加了來自 github 的依賴項:
implementation 'com.github.smarteist:autoimageslider:1.4.0-appcompat'
但是當在專案中添加這個依賴并同步專案時,并嘗試在我的 xml 檔案中使用這個庫。盡管專案已成功構建,但此庫未出現。
構建.gradle(應用程式):
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.nctr.cd.bmvp"
minSdk 26
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
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.gitee.archermind-ti:autoimageslider:1.0.0-beta'
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// room database dependency
def room_version = "2.4.3"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//retrofit http client dependency
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
//swipe refresh dependency to add pull to refresh for recycleView
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// dependency for gson
implementation 'com.google.code.gson:gson:2.9.1'
// dependency for loading image from url
implementation 'com.github.bumptech.glide:glide:4.11.0'
// google service dependency
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// auto image slider dependency
implementation 'com.github.smarteist:autoimageslider:1.4.0-appcompat'
}
uj5u.com熱心網友回復:
請檢查jcenter()您的 build.gradle 中是否缺少:
allprojects {
repositories {
google()
//here
jcenter()
mavenCentral()
}
}
并確保您的專案在 appcompat 依賴項上。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/509869.html
標籤:安卓毕业典礼
上一篇:在gradle中在哪里撰寫導航組件safeArgs依賴項
下一篇:任務':app:lintVitalRelease'執行失敗-':video_player_android:debugUnitTestRuntimeClasspath
