我知道Unirest可能不太好,但我非常需要它使用一些API。
由于我使用的是Gradle,因此无法遵循有关Maven的指南将其包含在我的Android Studio项目中,而我仅发现以下内容:
repositories {
...
maven{
url 'https://raw.github.com/zeeshanejaz/unirest-android/mvn-repo'
}
}
...
dependencies {
...
compile 'com.mashape.unirest:unirest-android:1.0+'
}
但是结果如下:
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20140107 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20140107 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20140107 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency commons-logging:commons-logging:1.1.3 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.6 is ignored for release as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.json:json:20140107 is ignored for release as it may be conflicting with the internal version provided by Android.
我不知道它是否会引起问题,所以请有人能解释一下如何在我的Android Studio项目中逐步加入Unirest吗?非常感谢你。
最佳答案
刚遇到同样的问题,找到了解决方案:
而不是添加:
maven{
url 'https://raw.github.com/zeeshanejaz/unirest-android/mvn-repo'
}
至:
buildscript {
...
repositories {
...
}
...
}
将其添加到:
allprojects {
...
repositories {
>HERE<
}
...
}
关于android - 使用Gradle将Unirest添加到Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46868802/