Buck fails to build non predex apps which include jars containing module-info.class files
Created by: kageiit
When an android app depends on gson 2.8.6 for example, buck fails to create a release apk (non predex) with the exception
Buck encountered an internal error
java.lang.RuntimeException: Error calculating size for module-info.class.
at com.facebook.buck.android.dalvik.DalvikStatsCache.getStats(DalvikStatsCache.java:54)
at com.facebook.buck.android.dalvik.DalvikAwareOutputStreamHelper.isEntryTooBig(DalvikAwareOutputStreamHelper.java:62)
at com.facebook.buck.android.dalvik.DalvikAwareOutputStreamHelper.canPutEntry(DalvikAwareOutputStreamHelper.java:76)
at com.facebook.buck.android.dalvik.DalvikAwareZipSplitter$2.visit(DalvikAwareZipSplitter.java:269)
at com.facebook.buck.jvm.java.classes.ClasspathTraversal$ZipFileTraversalAdapter$1.visit(ClasspathTraversal.java:90)
at com.facebook.buck.util.ZipFileTraversal.traverse(ZipFileTraversal.java:39)
at com.facebook.buck.jvm.java.classes.ClasspathTraversal$ZipFileTraversalAdapter.traverse(ClasspathTraversal.java:93)
at com.facebook.buck.jvm.java.classes.ClasspathTraversal.traverse(ClasspathTraversal.java:58)
at com.facebook.buck.jvm.java.classes.DefaultClasspathTraverser.traverse(DefaultClasspathTraverser.java:28)
at com.facebook.buck.android.dalvik.DalvikAwareZipSplitter.execute(DalvikAwareZipSplitter.java:250)
at com.facebook.buck.android.SplitZipStep.execute(SplitZipStep.java:209)
at com.facebook.buck.step.DefaultStepRunner.runStepForBuildTarget(DefaultStepRunner.java:46)
... 16 more
Caused by: java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1283)
at java.util.regex.Matcher.reset(Matcher.java:309)
at java.util.regex.Matcher.<init>(Matcher.java:229)
at java.util.regex.Pattern.matcher(Pattern.java:1093)
at com.facebook.buck.android.dalvik.DalvikStatsTool$StatsClassVisitor.visit(DalvikStatsTool.java:222)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:524)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)
at com.facebook.buck.android.dalvik.DalvikStatsTool.getEstimateInternal(DalvikStatsTool.java:147)
at com.facebook.buck.android.dalvik.DalvikStatsTool.getEstimate(DalvikStatsTool.java:132)
at com.facebook.buck.android.dalvik.DalvikStatsCache.getStats(DalvikStatsCache.java:48)
... 27 more
It seems like DalvikStatsStool should ignore module-info.class files as they should not affect the android runtime