最近作Android混淆打包遇到一些問題,Android Sdutio 3.1 版本打包的java
錯誤以下:app
Android studio warning - InnerClass annotations are missing corresponding EnclosingMember annotations
InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored.
Message{kind=WARNING, text=InnerClass annotations are missing corresponding EnclosingMember annotations. Such InnerClass annotations are ignored., sources=[Unknown source file], tool name=Optional.of(D8)}gradle
解決方案ui
在build.gradle中加入如下代碼便可code
buildTypes {blog
release {io
lintOptions {編譯
checkReleaseBuilds falseclass
abortOnError false打包
}
}
}
打包錯誤以下圖
看圖1
由於error以前,編譯的時候前面確定有warning. 翻了一下,果真發現不少warning.
有包 的33個 warning
com.yintong.secure com.icbc.pay
接下來只要在proguard-rules.pro加下這個庫的dontwarn便可
-dontwarn com.yintong.secure.** -dontwarn com.icbc.pay.**
再從新Build->Generate Signed,就能夠生成app-release.apk.