gradle 无法解析依赖项'com.github.smarteist:autoimageslider:1. 4. 0-appcompat'

vxf3dgd4  于 2022-11-14  发布在  Git
关注(0)|答案(1)|浏览(109)

在我的项目中,我正在尝试构建自动图像滑块视图,我正在使用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'
}
mrphzbgm

mrphzbgm1#

请检查您的构建版本中是否缺少jcenter()存储库。gradle:

allprojects {
    repositories {
        google()
        //here
        jcenter()
        mavenCentral()
   
    }
}

并且还要确保您的项目依赖于appcompat。

相关问题