Android Studio在build时,提示

Unable to find optional library: org.apache.http.legacy
是说找不到这个类。这是什么情况呢?

查阅文档发现,原来是Android 6.0不再支持 Apache HTTP client, 建议使用 HttpURLConnection 代替。如果还想要继续使用 Apache HTTP client 的,请在build.gradle中添加下面的代码

android {    useLibrary 'org.apache.http.legacy'}

重新同步build.gradle,问题就解决了!


更多相关文章

  1. Android EditText 为空提示 密码隐藏
  2. Android:只需一句话解决读写权限授予后仍提示 Permission denied
  3. 更新Anadroid SDK Tooks之后,Eclipse提示No update were found
  4. Eclipse For Android 代码自动提示功能
  5. 利用半透明对话框实现新浪微博android客户端首次运行时的提示界
  6. Android实现系统下拉栏的消息提示——Notification
  7. 【Androidd Release】AndroidStudio 发布apk 提示资源文件未翻译

随机推荐

  1. android 中如何在androidmanifest.xml设
  2. android下的异步任务
  3. 简单的网页源码查看器
  4. (血的经验!!)Android(安卓)Studio 如何导入别
  5. 修改apk调用蓝牙无明确提示
  6. Introducing home screen widgets and th
  7. android app 与电脑wifi通信(二)
  8. 图片内存溢出处理
  9. Android:使用TextureView预览Camera
  10. android 动态创建控件并设置布局