Android 未能解析:de.hdodenhof:circleimageview:2.1.0
尝试添加两个maven存储库,但似乎无法解决此问题。Android 未能解析:de.hdodenhof:circleimageview:2.1.0,android,android-studio,gradle,Android,Android Studio,Gradle,尝试添加两个maven存储库,但似乎无法解决此问题。 找不到有关stackoverflow的任何信息,并且想知道在Gradle中解决依赖关系的标准方法是什么 根构建.gradle buildscript { repositories { mavenCentral() // maven { url "https://mvnrepository.com/artifact/de.hdodenhof/circleimageview" } jcente
找不到有关stackoverflow的任何信息,并且想知道在Gradle中解决依赖关系的标准方法是什么 根构建.gradle
buildscript {
repositories {
mavenCentral()
// maven { url "https://mvnrepository.com/artifact/de.hdodenhof/circleimageview" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
// compile files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
compile 'de.hdodenhof:circleimageview:2.1.0'
}
模块构建.gradle
buildscript {
repositories {
mavenCentral()
// maven { url "https://mvnrepository.com/artifact/de.hdodenhof/circleimageview" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
// compile files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
compile 'de.hdodenhof:circleimageview:2.1.0'
}
未能解析:de.hdodenhof:circleimageview:2.1.0是否将
编译
依赖项添加到右侧的渐变文件中?确保compile'de.hdodenhof:circleimageview:2.1.0'
行位于dependencies{}
块中,并且该块位于模块文件夹中的build.gradle
文件中,而不是项目的根目录中
如果没有帮助,请尝试从命令行运行
/gradlew clean--refresh dependencies
。是否将编译
依赖项添加到正确的Gradle文件中?确保compile'de.hdodenhof:circleimageview:2.1.0'
行位于dependencies{}
块中,并且该块位于模块文件夹中的build.gradle
文件中,而不是项目的根目录中
如果没有帮助,请尝试从命令行运行
/gradlew clean--refresh dependencies
。我可以下载问题中所述的依赖项。不过,作为参考,这里是我的项目的build.gradle。我想你需要所有项目的部分。我遇到过一些问题,如果没有这些,依赖关系将无法解决
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
}
另外一个注意事项:如果您要编译克隆的回购协议,您可以这样做
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(":CircleImageView-master:circleimageview")
...
}
settings.gradle应该在哪里
include ':app', ':CircleImageView-master:circleimageview'
我可以下载问题中所写的依赖项。不过,作为参考,这里是我的项目的build.gradle。我想你需要所有项目的部分。我遇到过一些问题,如果没有这些,依赖关系将无法解决
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
}
另外一个注意事项:如果您要编译克隆的回购协议,您可以这样做
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(":CircleImageView-master:circleimageview")
...
}
settings.gradle应该在哪里
include ':app', ':CircleImageView-master:circleimageview'
是的,根gradle有存储库,模块gradle有依赖项。我已经更新了我的主要帖子。我已经在Android Studio中使用了clean构建,我相信它相当于gradlew clean,但我一弄明白就会尝试。不,它不相似,因为,--刷新依赖项
会使Gradle缓存无效,并强制再次下载所有依赖项。如果在Android Studio内部或外部运行,您应该从项目路径中的命令行运行它。我刚刚在Gradle构建中注意到了这一点。配置项目“”时出现问题:应用“”>无法解析配置“”的所有依赖项:应用:_debugCompile'>无法解析de.hdodenhof:circleimageview:2.1.0。>无法获取“”。>与被拒绝>的连接无法解析de.hdodenhof:circleimageview:2.1.0.>连接到refusedYep,根gradle具有存储库,模块gradle具有依赖项。我已经更新了我的主要帖子。我已经在Android Studio中使用了clean构建,我相信它相当于gradlew clean,但我一弄明白就会尝试。不,它不相似,因为,--刷新依赖项
会使Gradle缓存无效,并强制再次下载所有依赖项。如果在Android Studio内部或外部运行,您应该从项目路径中的命令行运行它。我刚刚在Gradle构建中注意到了这一点。配置项目“”时出现问题:应用“”>无法解析配置“”的所有依赖项:应用:_debugCompile'>无法解析de.hdodenhof:circleimageview:2.1.0。>无法获取“”。>与被拒绝>的连接无法解析de.hdodenhof:circleimageview:2.1.0.>连接到refusedJust意识到问题与依赖关系无关,但与我的代理有关,因为当我连接到WiFi热点而不是公司代理时,我能够编译依赖关系。Just意识到问题与依赖关系无关,但与我的代理有关,因为我能够编译连接到WiFi热点而不是公司代理时的相关性