zoukankan      html  css  js  c++  java
  • Android Studio错误:Failed to resolve: com.github.zhpanvip:BannerViewPager:latestVersion

    报错原因是找不到这个依赖

    解决方法

    1、添加仓库,我加粗的那两句话。

    buildscript {
        repositories {
            // 以下四行添加阿里云的仓库地址,方便国内开发者下载相关插件
            maven { url 'https://maven.aliyun.com/repository/jcenter' }
            maven { url 'https://maven.aliyun.com/repository/google'}
            maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
            maven { url 'https://maven.aliyun.com/repository/public'}
            google()
    //        jcenter()
            maven { url 'https://jitpack.io' }
            
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.5.3'
            
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            // 以下四行添加阿里云的仓库地址,方便国内开发者下载相关插件
            maven { url 'https://maven.aliyun.com/repository/jcenter' }
            maven { url 'https://maven.aliyun.com/repository/google'}
            maven { url 'https://maven.aliyun.com/repository/gradle-plugin'}
            maven { url 'https://maven.aliyun.com/repository/public'}
            google()
    //        jcenter()
            maven { url 'https://jitpack.io' }
            
        }
    }

    2、添加依赖——这样插入是错误的。将latestVersion改为最近的版本号

    implementation 'com.github.zhpanvip:bannerviewpager:latestVersion'

    正确写法

        implementation 'com.github.zhpanvip:bannerviewpager:3.5.4'
  • 相关阅读:
    BZOJ 3330 分数
    FR #11题解
    BZOJ 1857 传送带
    BZOJ 4757 Building a Tall Barn
    FR #10题解
    BZOJ 4393 Fruit Feast
    BZOJ 3126 Photo
    BZOJ 1312 Hard Life
    BZOJ 2039 employ人员雇佣
    Count SIN Numbers
  • 原文地址:https://www.cnblogs.com/hahayixiao/p/15527277.html
Copyright © 2011-2022 走看看