解决 android studio 中的 gradle 依赖问题? [英] Issue resolving gradle dependency in android studio?

查看:31
本文介绍了解决 android studio 中的 gradle 依赖问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 https://android-arsenal.com/details/1/1375 添加样式化的进度条

上面写着:

将特定存储库添加到您的构建文件:

Add the specific repository to your build file:

repositories {
   maven {
      url "https://jitpack.io"
   }
}

在您的构建文件中添加依赖项(不要忘记指定正确的限定符,通常是aar"):

Add the dependency in your build file (do not forget to specify the correct qualifier, usually 'aar'):

dependencies {
   compile 'com.github.akexorcist:Android-RoundCornerProgressBar:1.0.0'
}

好吧,我做到了……build.gradle(项目)

Well I did that... build.gradle (Project)

buildscript {
repositories {
    jcenter()
    maven {
      url "https://jitpack.io"
   }

}
  dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  }
}

allprojects {
  repositories {
    jcenter()
  }
}

build.gradle(模块):应用插件:'com.android.application'

build.gradle (Module): apply plugin: 'com.android.application'

安卓{compileSdkVersion 21buildToolsVersion "21.1.2"

android { compileSdkVersion 21 buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.chaz.simsirl"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:21.0.3'
   compile 'com.github.akexorcist:Android-RoundCornerProgressBar:1.0.0'
}

然后在消息中说:错误:配置项目:app"时出现问题.

Then in messages it says: Error:A problem occurred configuring project ':app'.

无法解析配置 ':app:_debugCompile' 的所有依赖项.找不到 com.akexorcist:Android-RoundCornerProgressBar:1.0.0.在以下位置搜索:https://jcenter.bintray.com/com/akeexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pomhttps://jcenter.bintray.com/com/akeexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar文件:/C:/Users/pc/AppData/Local/Android/sdk/extras/android/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pom文件:/C:/Users/pc/AppData/Local/Android/sdk/extras/android/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar文件:/C:/Users/pc/AppData/Local/Android/sdk/extras/google/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pom文件:/C:/Users/pc/AppData/Local/Android/sdk/extras/google/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar要求:SimsIRL:app:unspecified

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.akexorcist:Android-RoundCornerProgressBar:1.0.0. Searched in the following locations: https://jcenter.bintray.com/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pom https://jcenter.bintray.com/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar file:/C:/Users/pc/AppData/Local/Android/sdk/extras/android/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pom file:/C:/Users/pc/AppData/Local/Android/sdk/extras/android/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar file:/C:/Users/pc/AppData/Local/Android/sdk/extras/google/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.pom file:/C:/Users/pc/AppData/Local/Android/sdk/extras/google/m2repository/com/akexorcist/Android-RoundCornerProgressBar/1.0.0/Android-RoundCornerProgressBar-1.0.0.jar Required by: SimsIRL:app:unspecified

推荐答案

尝试用这个替换你的依赖:

Try to replace your dependency with this:

compile 'com.akexorcist:RoundCornerProgressBar:1.0.0' 

在 jCenter 中可用.

This package is available in jCenter.

然后你可以删除这个:

maven {
   url "https://jitpack.io"
}

参考:https://github.com/akexorcist/Android-RoundCornerProgressBar#download

这篇关于解决 android studio 中的 gradle 依赖问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆