out/target/common/obj/PACKAGING/public_api.txt android.view.KeyEvent.KEYCODE_has changed value from

编译出错:

out/target/common/obj/PACKAGING/public_api.txt:22549: error 17: Field android.view.KeyEvent.KEYCODE_STAR has changed value from 17 to 227
out/target/common/obj/PACKAGING/public_api.txt:22636: error 17: Field android.view.KeyEvent.KEYCODE_POUND has changed value from 18 to 228


******************************
You have tried to change the API from what has been previously released in
an SDK.  Please fix the errors listed above.
******************************

解决办法:

自己找到了在framework/base/api 下有n(n取决于你源码的版本,如果你源码的版本是4.0.4 ,那么就 有分别以 1~ 15命名的xml或txt,就是api level)个xml或txt文档,分别对应android api 的不同版本。   在这些xml中,把你在framework层中修改的地方对应进去。 如我这个错误的地方,在15.txt 和 current.xml 中找到“KEYCODE_STAR”,把里面的value 值改成和你代码中值一致就可以了。

原文地址:https://www.cnblogs.com/riskyer/p/3278122.html