system-api.txt:27075: error 13 has added 'final' qualifier

来源:互联网 发布:线切割编程3b 编辑:程序博客网 时间:2024/06/03 21:39

修改android N源码过程中如果修改了原始的api导致编译出现如下错误,解决方法是让prebuilts/sdk/system-api/25.txt中的声明和frameworks/base/api/system-current.txt或者current.txt保持一致

错误log如下:

FAILED: /bin/bash -c "(( out/host/linux-x86/bin/apicheck -JXmx1024m -J\"classpath /usr/lib/jvm/java-8-openjdk-amd64/bin/../lib/tools.jar:out/host/linux-x86/framework/doclava.jar:out/host/linux-x86/framework/jsilver.jar\"  -hide 2 -hide 3 -hide 4 -hide 5 -hide 6 -hide 24 -hide 25 -hide 26 -hide 27 -error 7 -error 8 -error 9 -error 10 -error 11 -error 12 -error 13 -error 14 -error 15 -error 16 -error 17 -error 18   prebuilts/sdk/system-api/25.txt  out/target/common/obj/PACKAGING/system-api.txt  frameworks/base/api/system-removed.txt  out/target/common/obj/PACKAGING/system-removed.txt || (  cat build/core/apicheck_msg_last.txt ; exit 38 ) ) ) && (mkdir -p out/target/common/obj/PACKAGING/ ) && (touch out/target/common/obj/PACKAGING/checksystemapi-last-timestamp )"out/target/common/obj/PACKAGING/system-api.txt:27074: warning 23: Class android.net.wifi.WifiManager.WpsCallback changed class/interface declarationout/target/common/obj/PACKAGING/system-api.txt:27075: error 13: Method android.net.wifi.WifiManager.WpsCallback.onFailed(int) has added 'final' qualifierout/target/common/obj/PACKAGING/system-api.txt:27076: error 13: Method android.net.wifi.WifiManager.WpsCallback.onStarted(String) has added 'final' qualifierout/target/common/obj/PACKAGING/system-api.txt:27077: error 13: Method android.net.wifi.WifiManager.WpsCallback.onSucceeded() has added 'final' qualifierout/target/common/obj/PACKAGING/system-api.txt:47567: error 17: Field prebuilts/sdk/system-api/25.txt:27030: error 9: Removed public constructor android.net.wifi.WifiManager.WpsCallback.WifiManager.WpsCallback()

api的源,或者说是正确的api在如下两个路径
prebuilds/sdk/system-api/XX.txt
prebuilds/sdk/api/XX.txt
XX指api level
上面的错误api level就是25

make update-api生成
system-api.txt和current.txt

make的时候会用生成的这两个txt与api的源进行比较,如果不一致就会编译失败产生类似的错误

修正方式就是让源和编译生成的api一致

阅读全文
0 0