最近做Android混淆打包遇到一些问题,Android Sdutio 3.1 版本打包的

错误如下:

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)}

 

解决方案

在build.gradle中加入以下代码即可

buildTypes {

    release {

        lintOptions {

            checkReleaseBuilds false

            abortOnError false

        }

    }

}

打包错误如下图

 

android -------- 混淆打包报错(warning - InnerClass annotations are missing corresponding EnclosingMember annotations)

 

android -------- 混淆打包报错(warning - InnerClass annotations are missing corresponding EnclosingMember annotations)

看图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.

 

相关文章:

  • 2022-02-08
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-09-10
  • 2022-12-23
  • 2021-09-03
  • 2022-01-18
相关资源
相似解决方案