获取应用的cachesize时,用到了aidl,IPackageStatsObserver接口,编译完release apk,运行时出错。
原因:IPackageStatsObserver被proguard规则混淆了,
解决方案:在proguard-rules.pro中添加如下规则:
-keepnames public interface android.content.pm.IPackageStatsObserver { *; }
-keepnames public interface android.content.pm.IPackageDataObserver { *; }
-keepnames public interface android.content.pm.PackageStats { *; }
-keep class android.content.pm.IPackageStatsObserver