Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译报错 #12

Closed
751643992 opened this issue Jul 23, 2018 · 3 comments
Closed

编译报错 #12

751643992 opened this issue Jul 23, 2018 · 3 comments
Labels

Comments

@751643992
Copy link

Error:Execution failed for task ':app:transformClassesWithStringFogForDebug'.

java.util.zip.ZipException: attempt to write past end of STORED entry

classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle-experimental:0.11.0'
classpath 'com.github.megatronking.stringfog:gradle-plugin:1.4.0'

implementation 'com.github.megatronking.stringfog:lib:1.2.2'

@MegatronKing
Copy link
Owner

初步定为到是Java 8导致的问题。AS在编译的时候会进行脱糖(desugar)操作,将lambda的语法糖还原,这一步发生在stringFog处理字节码之前,导致后面的stringFog时处理jar文件异常(有点随机性,尚不确定具体原因)。这个问题修复还需要一些时间,如果紧急的话可以选择下面两个方式其中之一规避:

  1. 移除Java 8的支持,删除下面的配置:
compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
  1. 使用retrolambda插件来支持Java 8的lambda表达式。

@751643992
Copy link
Author

好的

@MegatronKing
Copy link
Owner

问题已经完全定位并解决,AS对desugar时生成的jar包的压缩方式做了修改,stringFog使用此jar包解压文件再进行字节码加密后重新jar包时会有问题。稍后会发布1.4.1版本,修复此问题。

MegatronKing pushed a commit that referenced this issue Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants