目前正在尝试构建android-5.1.0_r5。我查看了消息来源,没有做任何修改。但是,在编译时我收到以下错误。
Checking API: checkpublicapi-current
out/target/common/obj/PACKAGING/public_api.txt:20: error 5: Added public field android.Manifest.permission.BACKUP
out/target/common/obj/PACKAGING/public_api.txt:82: error 5: Added public field android.Manifest.permission.INVOKE_CARRIER_SETUP
out/target/common/obj/PACKAGING/public_api.txt:106: error 5: Added public field android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE
out/target/common/obj/PACKAGING/public_api.txt:116: error 5: Added public field android.Manifest.permission.RECEIVE_EMERGENCY_BROADCAST
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "@hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
并且公开api txt文件确实显示出差异。
diff frameworks/base/api/current.txt out/target/common/obj/PACKAGING/public_api.txt
19a20
> field public static final java.lang.String BACKUP = "android.permission.BACKUP";
80a82
> field public static final java.lang.String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP";
103a106
> field public static final java.lang.String READ_PRIVILEGED_PHONE_STATE = "android.permission.READ_PRIVILEGED_PHONE_STATE";
112a116
> field public static final java.lang.String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST";
但是,我无法弄清楚那些额外的公共领域来自哪里。有什么想法吗?
答案 0 :(得分:9)
如果你没碰到任何东西,不要做'make update-api'。另外apis来自框架/ base / res / AndroidManifest.xml由aapt严重解析,使用buggy system / core / libcore / String8.cpp @@ removeAll()他们使用memcpy但应该memmove用于内存中重叠的字符串。
这是最新的Debian(sid)或Ubuntu(16个可能是15个)构建机器上的问题。 这是libcore / String8.cpp中的一个google bug。修复在这里: https://android.googlesource.com/platform/system/core/+/dd060f01f68ee0e633e9cae24c4e565cda2032bd
这个人发现了它(迈克尔斯科特),也许还有其他人。以下是他的调查:https://plus.google.com/+hashcode0f/posts/URHo3hBmfHY
自大了!
答案 1 :(得分:4)
我确实看到了我的r8代码中的条目,所以你可能安全地运行make update-api,当它完成时,然后正常运行你的make命令。