- Android应用导入Apache包错误解决方法
- idea 迁移到AS 出现 databanding cannot
- 解决XCode报错:The “Swift Language Ve
- 解决XCode报错:The “Swift Language Ve
- Cocos2d-x 3.10 学习笔记之安卓打包编译报错问题汇总
- “Use Legacy Swift Language Versi
- Android之解决Error(Unable to find m
- 解决 Android Studio出现 Gradle'
- Mac系统下Android Studio使用gradle命令行打
- android studio library 模块引用aar
原来在4.4源码上能编译通过的代码,放到6.0上就编译不通过,有如下错误提示:
ERROR: /home/guochongxin/slam/xxx.java:14: The import org.apache.http.HttpEntity cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:15: The import org.apache.http.HttpResponse cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:16: The import org.apache.http.client cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:17: The import org.apache.http.client cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:18: The import org.apache.http.client cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:19: The import org.apache.http.impl cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:20: The import org.apache.http.message cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:22: The import org.apache.http.protocol cannot be resolved
ERROR: /home/guochongxin/slam/xxx.java:593: DefaultHttpClient cannot be resolved to a type
解决方法是:
1.修改Android.mk,添加LOCAL_JAVA_LIBRARIES += org.apache.http.legacy
2.修改AndroidManifest.xml,在application节中添加:
<uses-library android:name="org.apache.http.legacy" android:required="false" />
网友评论