gpt4 book ai didi

android - 使用Gradle将Unirest添加到Android Studio

转载 作者:行者123 更新时间:2023-12-03 04:51:07 25 4
gpt4 key购买 nike

我知道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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com