matrix icon indicating copy to clipboard operation
matrix copied to clipboard

Matrix Android ApkChecker检测unused assets不准确

Open hansionit opened this issue 5 years ago • 5 comments

异常类型:Matrix Android ApkChecker检测unused assets不准确

matrix版本:如: 0.6.0

gradle版本:如: 5.1.1

问题描述:如:Matrix Android ApkChecker检测unused assets不准确 

检测出的Asset目录中的无用资源,其实在项目中基本都在使用的,结果不准确,希望能优化下

hansionit avatar Aug 15 '19 08:08 hansionit

可以给个具体的例子看看? @hansionit

jqctop1 avatar Aug 15 '19 08:08 jqctop1

比如assetes目录中有一个html文件,我在webview中加载,可以检测到html文件是被引用的,但html文件引用的图片 css js检测是不被引用的

hansionit avatar Aug 16 '19 01:08 hansionit

比如 lottie 中用如下的方法配置动画资源:

<com.airbnb.lottie.LottieAnimationView
        android:layout_width="186dp"
        android:layout_height="186dp"
        app:lottie_autoPlay="true"
        app:lottie_fileName="b.json"
        app:lottie_loop="true" />

这种情况下 assets 目录下的 b.json 就会被判定为未使用的,但其实是在用的

Cr321 avatar Aug 24 '21 11:08 Cr321

请问未使用assert这个问题有解决吗,使用的时候发现还是有问题。全部assert文件都被认为没有使用过。这里有什么前置条件之类的吗

gdchaochao avatar Sep 14 '21 08:09 gdchaochao

1.比如说我在代码中设置lottie:

LottieImageView img = findViewById(R.id.img);
img.setAnimation("data.json");

2.还有就是设置字体库:

Typeface.createFromAsset(getContext().getAssets(), "a.ttf")

assets 目录下的资源 data.json、a.ttf实际是有引用的,但是检测结果却显示为unused

libq avatar Sep 28 '22 05:09 libq