[英]d8 dex compilation fails with desugaring
I can't get d8 dex compiler to compile my jar package:我无法让 d8 dex 编译器编译我的 jar package:
$ wget https://repo1.maven.org/maven2/org/mockito/mockito-core/3.6.0/mockito-core-3.6.0.jar
$ java -jar d8_2.1.86.jar --output /tmp mockito-core-3.6.0.jar 2>&1 >/dev/null | grep "Compilation"
com.android.tools.r8.errors.CompilationError: Class or interface java.lang.RuntimeException required for desugaring of try-with-resources is not found.
Compilation failed
I tried to read about desugaring problems but couldn't get very far - what's wrong with this jar?我试图阅读有关脱糖问题的信息,但无法深入了解 - 这个 jar 有什么问题?
If you pass android.jar or the java runtime jar as --lib to your compilation you will not see that exception.如果您将 android.jar 或 java 运行时 Z68995--FCBF432492D15484D04A9 传递给您的编译,您将不会看到该异常。 There is, however, a lot of other warnings in your d8 compilation, because types that are needed for desugaring are not present.但是,在您的 d8 编译中还有很多其他警告,因为不存在脱糖所需的类型。 These are from dependencies of the mockito package that you don't have in your input or on classpath.这些来自您在输入或类路径中没有的 mockito package 的依赖项。 See also: https://developer.android.com/studio/command-line/d8#j8另请参阅: https://developer.android.com/studio/command-line/d8#j8
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.