【发布时间】:2014-04-08 21:08:20
【问题描述】:
我正在开发一个大型应用程序,有多少库,我达到了 65k 方法的限制,我想清理一些库以缩小方法的大小。现在我正在使用 proguard,但这需要 5 分钟来编译!所以,我需要一种在 proguard 之前清理的方法(比如用 build.gradle 排除或类似的东西) 我正在尝试使用这样的东西:
compile ('com.google.android.gms:play-services:4.3.+'){
exclude group: 'com.google.android.gms.drive'
exclude group: 'com.google.android.gms.games'
}
但它不起作用,你知道吗?
【问题讨论】:
-
我不知道
exclude group会从依赖项中删除单个类或命名空间。这里的“组”是指工件组 AFAIK。使用 Jake Wharton's shell script 确定 65K 方法引用的来源,并尝试用更紧凑的库替换库(例如,使用 Wire 或 micro-protobuf 代替 protobuf)。