赞
踩
kotlin编译遇到问题:
> Task :app:transformClassesWithDesugarForDebug
transformClassesWithDesugarForDebug executing ...
Exception in thread "main" java.lang.NullPointerException: Couldn't find outer class com/xxxx/xxxxx/xxxx/xxxx/xxxx/xxxx$initData$1$1$1$1 of com/xxxx/xxxx/xxxx/xxxx/xxx/xxxx$initData$1$1$1$1$2
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:1079)
at com.google.devtools.build.android.desugar.ClassVsInterface.isOuterInterface(ClassVsInterface.java:56)
at com.google.devtools.build.android.desugar.InterfaceDesugaring.visitOuterClass(InterfaceDesugaring.java:246)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:638)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:500)
at com.google.devtools.build.android.desugar.Desugar.desugarClassesInInput(Desugar.java:477)
at com.google.devtools.build.android.desugar.Desugar.desugarOneInput(Desugar.java:361)
at com.google.devtools.build.android.desugar.Desugar.desugar(Desugar.java:314)
at com.google.devtools.build.android.desugar.Desugar.main(Desugar.java:711)
> Task :app:transformClassesWithDesugarForDebug FAILED
transformClassesWithDesugarForDebug done costTime = 0 m 10 s 448ms
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDesugarForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.google.devtools.build.android.desugar.Desugar with arguments {--input
翻阅了stack overflow上的多种方法无果,后同事告知是由于kotlin let语句多层嵌套导致(手动牛逼),去掉initData中嵌套的let层级,编辑就可以通过了,记录一下。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。