Failed to build aosp
[ 0% 18/12890] //libcore/mmodules/core_platform_api:art.module.platform.api.stubs javac [common]
FAILED: out/soong/.intermediates/libcore/mmodules/core_platform_api/art.module.platform.api.stubs/android_common/javac/art.module.platform.api.stubs.jar
out/soong/.intermediates/libcore/mmodules/core_platform_api/art.module.platform.api.stubs/android_common/javac/srcjars/java/lang/Double.java:106: error: self-reference in initializer
public static final double NaN = NaN;
^
out/soong/.intermediates/libcore/mmodules/core_platform_api/art.module.platform.api.stubs/android_common/javac/srcjars/java/lang/Float.java:108: error: cannot find symbol
public static final float NaN = NaNf;
^
symbol: variable NaNf
location: class Float
2 errors
在每个文件中,Double.java文件NaN = 0.0d / 0.0;在我试图修改这些文件之后,生成具有相同错误的重新生成它们。这些文件在源文件中的位置以及如何修复这些错误?谢谢你的回答。
发布于 2022-03-15 05:25:12
它们是从元宝里运来的。
文件src/main/java/com/android/tools/metalava/model/FieldItem.kt
我敢打赌您已经更新了kotlinc,所以代码现在不像预期的那样工作了。这里有两个部分。一个双倍,一个浮子。这两种方法在kotlin 1.5+中都不像预期的那样工作
所以你应该换掉
is Float -> {
writer.print(" = ")
when (value) {
Float.POSITIVE_INFINITY -> writer.print("(1.0f/0.0f);")
Float.NEGATIVE_INFINITY -> writer.print("(-1.0f/0.0f);")
Float.NaN -> writer.print("(0.0f/0.0f);")
}
}
通过
is Float -> {
writer.print(" = ")
when {
value == Float.POSITIVE_INFINITY -> writer.print("(1.0f/0.0f);")
value == Float.NEGATIVE_INFINITY -> writer.print("(-1.0f/0.0f);")
java.lang.Float.isNaN(value) -> writer.print("(0.0f/0.0f);")
else -> {
writer.print(canonicalizeFloatingPointString(value.toString()))
writer.print("f;")
}
}
}
相同的双,替换块
is Double -> {
writer.print(" = ")
when (value) {
Double.POSITIVE_INFINITY -> writer.print("(1.0/0.0);")
Double.NEGATIVE_INFINITY -> writer.print("(-1.0/0.0);")
Double.NaN -> writer.print("(0.0/0.0);")
else -> {
writer.print(canonicalizeFloatingPointString(value.toString()))
writer.print(";")
}
}
}
通过
is Double -> {
writer.print(" = ")
when {
value == Double.POSITIVE_INFINITY -> writer.print("(1.0/0.0);")
value == Double.NEGATIVE_INFINITY -> writer.print("(-1.0/0.0);")
java.lang.Double.isNaN(value) -> writer.print("(0.0/0.0);")
else -> {
writer.print(canonicalizeFloatingPointString(value.toString()))
writer.print(";")
}
}
}
https://stackoverflow.com/questions/70136763
复制相似问题