前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >安卓编译 instances of library classes depending on program classes

安卓编译 instances of library classes depending on program classes

作者头像
叉叉敌
发布2020-02-21 11:40:08
9370
发布2020-02-21 11:40:08
举报
文章被收录于专栏:ChasaysChasays

问题

执行命令:

代码语言:javascript
复制
/bin/bash -c "external/proguard/bin/proguard.sh -injars 'out/target/common/obj/APPS/TileLauncher_intermediates/classes-desugar.jar' -outjars out/target/common/obj/APPS/TileLauncher_intermediates/classes-proguard.jar -libraryjars out/target/common/obj/APPS/TileLauncher_intermediates/proguard_dictionary -forceprocessing -include build/core/proguard.flags -dontobfuscate -dontoptimize -include out/target/common/obj/APPS/TileLauncher_intermediates/proguard_options"

错误的结果

代码语言:javascript
复制
ProGuard, version 5.1

Reading library jar [ out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar]
Reading library jar [ out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/classes.jar]
Reading library jar [ out/target/common/obj/JAVA_LIBRARIES/core-lambda-stubs_intermediates/classes.jar]
Warning: library class android.hardware.cas.V1_0.ICas extends or implements program class android.hidl.base.V1_0.IBase
Warning: library class android.hardware.cas.V1_0.ICasListener extends or implements program class android.hidl.base.V1_0.IBase

Warning: there were 16 instances of library classes depending on program classes.
	  You must avoid such dependencies, since the program classes will
	  be processed, while the library classes will remain unchanged.
	  (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency)
Error: Please correct the above warnings first.

解决方法

根据关键字找到官网的建议方法。 https://www.guardsquare.com/en/products/proguard/manual/troubleshooting#dependency

If you don’t feel like filtering out the problematic classes, you can try your luck with the -ignorewarnings option, or even the -dontwarn option. Only use these options if you really know what you’re doing though.

只需要在ProGuard 规则文件build/core/proguard.flags末尾加上过滤信息即可。 在文件上修改,即可。重新执行。

代码语言:javascript
复制
-dontwarn android.hidl.base.**
-keep class android.hidl.base.**

修改后的结果,没有错误

代码语言:javascript
复制
ProGuard, version 5.1
Reading program jar [out/target/common/obj/APPS/TileLauncher_intermediates/classes-desugar.jar]
  Copying resources from program jar [out/target/common/obj/APPS/TileLauncher_intermediates/classes-desugar.jar]
``
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-02-17 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 问题
  • 解决方法
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档