![](/img/trans.png)
[英]Warning:Dependency org.apache.httpcomponents:httpclient:4.2.1 is ignored when using jfrog and android-maven-plugin
[英]Gradle error: Could not find org.apache.httpcomponents:httpclient-android:4.3.5.1
我正在尝试在我的Gradle项目中使用Apache httpclient for Android,我不明白为什么在运行./gradle build
时出现此错误:
找不到org.apache.httpcomponents:httpclient-android:4.3.5.1。
我的顶级build.gradle包含:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
我的项目build.gradle以:
apply plugin: 'com.android.application'
dependencies {
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':workspace:google_play_services:libproject:google-play-services_lib')
}
这有什么问题?
在Maven的Central Repository Browser中我列出了我需要的包: http : //search.maven.org/#browse|-305040853
您必须在项目 build.gradle
添加
repositories {
mavenCentral()
}
如果您想将它放在顶级文件中,可以在顶级 build.gradle
添加它:
allprojects {
repositories {
mavenCentral()
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.