我如何解决 android Studio 中的依赖性警告?

How do i resolve Dependency Warning's in android Studio?

我是 android 应用程序开发的新手

当我在 android studio 中清理和构建应用程序时,Gradle 构建显示这些警告。

警告:警告:调试忽略依赖项 org.apache.httpcomponents:httpclient:4.5.1,因为它可能与 Android.

提供的内部版本冲突

警告:警告:依赖项 org.apache.httpcomponents:httpclient:4.5.1 在发布时被忽略,因为它可能与 Android 提供的内部版本冲突。

警告:与依赖项冲突'com.google.code.findbugs:jsr305'。应用程序 (1.3.9) 和测试应用程序 (2.0.1) 的已解决版本不同。有关详细信息,请参阅 http://g.co/androidstudio/app-test-app-conflict

如何解决这些警告?

方式一:

您需要在build.gradle

中使用以下内容
android{
   useLibrary 'org.apache.http.legacy'
}

如果您使用最新版本的 android SDK。

方式二:

使用HttpURLConnection class代替HTTPClient. HttpURLConnection比HTTPClient效率更高