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


    问题

    执行命令:

    /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"
    

    错误的结果

    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末尾加上过滤信息即可
    在文件上修改,即可。重新执行。

    -dontwarn android.hidl.base.**
    -keep class android.hidl.base.**
    

    修改后的结果,没有错误

    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]
    ``
    
  • 相关阅读:
    ELK7.X中配置x-pack
    ELK报错及解决方案
    ELK + filebeat集群部署
    CentOS7.6中 KVM虚拟机内存、CPU调整
    Linux 设置定时清除buff/cache的脚本
    Nginx中配置https中引用http的问题
    使用Docker搭建Jumpserver堡垒机
    CenterOS7中解决No package mysql-server available.
    Tomcat启动慢的原因及解决方法
    记录 之-- java 的一些小技巧
  • 原文地址:https://www.cnblogs.com/ievjai/p/14382656.html
Copyright © 2020-2023  润新知