如何将外部依赖项(jar 文件)添加到 android studio? [英] How to add external dependencies (jar file) to android studio?

查看:39
本文介绍了如何将外部依赖项(jar 文件)添加到 android studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将外部库(httpmime-4.0-sources.jar)添加到 android 项目中,因为 android-studio 会弹出像

I am trying to add external libraries(httpmime-4.0-sources.jar) to android project irked by the fact that android-studio is popping up errors like

  • 错误:包 org.apache.http.entity.mime 不存在
  • 错误:找不到符号类 MultipartEntity
  • 错误:找不到符号类HttpMultipartMode

我需要帮助.

作为一种实践,我将 jar 文件复制到 lib 文件夹并将其添加为库.但错误并没有消失.

As a practice I copied the jar file to the lib folder and added that as a library. But the error does not go away.

推荐答案

循序渐进

  1. 将 JAR 文件复制到 libs 文件夹
  2. 在 build.gradle 文件中注册模块,步骤 3 到 9 中给出了相关说明
  3. 打开文件菜单并点击项目结构
  4. 现在在项目结构对话框中选择模块下的应用程序
  5. 现在单击项目结构对话框中的依赖项选项卡
  6. 点击右上角的+号
  7. 从列表中选择文件依赖
  8. 从libs文件夹中选择jar文件
  9. 点击应用并确定
  10. 最后点击同步gradle按钮

还有一件事,如果您正在使用代理连接,请检查它.

One more thing, check for proxy connection if you are using it.

这篇关于如何将外部依赖项(jar 文件)添加到 android studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆