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

编译不通过 #23

Closed
ooftf opened this issue Dec 7, 2019 · 9 comments
Closed

编译不通过 #23

ooftf opened this issue Dec 7, 2019 · 9 comments

Comments

@ooftf
Copy link

ooftf commented Dec 7, 2019

Execution failed for task ':app:transformClassesWithAuto-registerForDebug'.

java.lang.ArrayIndexOutOfBoundsException (no error message)

经过排查好像是CodeScanProcessor类的
//refer hack class when object init
boolean scanClass(InputStream inputStream, String filePath) {
ClassReader cr = new ClassReader(inputStream)
ClassWriter cw = new ClassWriter(cr, 0)
ScanClassVisitor cv = new ScanClassVisitor(Opcodes.ASM5, cw, filePath)
cr.accept(cv, ClassReader.EXPAND_FRAMES)
inputStream.close()

    return cv.found
}

中的new ClassReader(inputStream)报出的错误,这个地方扫描的类名好像是module-info.class具体什么原因产生的我也不懂。。。希望能改进一下

@ooftf
Copy link
Author

ooftf commented Dec 7, 2019

貌似是和gson 2.8.6版本不兼容导致的

@ooftf
Copy link
Author

ooftf commented Jan 19, 2020

这个还会更新吗

@naturs
Copy link

naturs commented Feb 12, 2020

对,我这把gson升级到2.8.6也会编译失败,2.8.5没问题

@leigao109
Copy link

gson 2.8.6里面用到了java 9的模块化,目前我把'module-info'给排除了,可以编译通过,但不知道会不会有其他影响。

@zhuangjiahua
Copy link

我这里用的gson 2.8.5,但还是会报这个错,请问怎么解决?

@zhuangjiahua
Copy link

@leigao109
gson 2.8.6里面用到了java 9的模块化,目前我把'module-info'给排除了,可以编译通过,但不知道会不会有其他影响。

module-info这个是什么?

@ooftf
Copy link
Author

ooftf commented Apr 30, 2020

应该是你用的包里面,间接引用了gons 2.8.6,你可以打印一下依赖树,看最终引用版本,如果是2.8.6,强制改成2.8.5

@ooftf
Copy link
Author

ooftf commented Sep 18, 2020

这个问题已经在https://github.com/ooftf/AutoRegister 解决

@liujingxing
Copy link

@leigao109 如何排除的module-info.class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants