使用OkHttp,放到framework层编译,编译错误:

Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirementWarning: okio.Okio: can't find referenced class java.nio.file.FilesWarning: okio.Okio: can't find referenced class java.nio.file.FilesWarning: okio.Okio: can't find referenced class java.nio.file.FilesWarning: okio.Okio: can't find referenced class java.nio.file.PathWarning: okio.Okio: can't find referenced class java.nio.file.OpenOptionWarning: okio.Okio: can't find referenced class java.nio.file.PathWarning: okio.Okio: can't find referenced class java.nio.file.OpenOptionWarning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirementWarning: okio.Okio: can't find referenced class java.nio.file.PathWarning: okio.Okio: can't find referenced class java.nio.file.OpenOptionWarning: okio.Okio: can't find referenced class java.nio.file.PathWarning: okio.Okio: can't find referenced class java.nio.file.OpenOptionWarning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirementWarning: there were 14 unresolved references to classes or interfaces.         You may need to add missing library jars or update their versions.         If your code works fine without the missing classes, you can suppress         the warnings with '-dontwarn' options.         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)Error: Please correct the above warnings first.

编译环境:

  • Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.16.0-40-generic x86_64)

  • miyuehu@ubuntu:~$ java -version

  • java version “1.7.0_101”
  • OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.14.04.1)
  • OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

github okhttp FAQs

https://github.com/square/okhttp/issues/964
大牛回复
Nope. They are safe to ignore!

擦,不用管。
关键提示信息:“the warnings with ‘-dontwarn’ options”
////////////////////////////////////////////////////////////////

修改Android.mk

###使能proguard.cfgLOCAL_PROGUARD_ENABLED := fullLOCAL_PROGUARD_FLAG_FILES := proguard.cfgLOCAL_CERTIFICATE := platforminclude $(BUILD_PACKAGE)include $(CLEAR_VARS)LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := okhttp:libs/okhttp-3.5.0.jar LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += okio:libs/okio-1.11.0.jarinclude $(BUILD_MULTI_PREBUILT)

修改proguard.cfg

-dontwarn okio.**

目录结构:
.
├── AndroidManifest.xml
├── Android.mk
├── assets
├── libs
│?? ├── okhttp-3.5.0.jar
│?? └── okio-1.11.0.jar

更多相关文章

  1. Android下修改SeekBar样式
  2. Android: 修改ramdisk.img
  3. android之listView之增删改查
  4. Ubuntu 10.04编译Android(安卓)2.2 源代码
  5. android + eclipse + 后台静默安装(一看就会)
  6. Build android source code 3 -- 编译
  7. android lint检查出现的问题
  8. Android中Broadcast的Intent大全
  9. Unable to execute dex: java.nio.BufferOverflowException.

随机推荐

  1. 纯色titlebar抗遮挡布局的实现
  2. Android(安卓)Studio实现简单的登陆界面
  3. Android(安卓)SurfaceFlinger 学习之路(
  4. Android(安卓)mvparms 踩坑
  5. Android内存分析AndroidStudio的运用
  6. Android(安卓)Camera从App层到framework
  7. Android悬浮按钮点击返回顶部FloatingAct
  8. Flutter入门,学习历程,进入开发,在安卓手机
  9. Android传统布局
  10. Android-Universal-Image-Loader 源码解