2015-06-23 16 views
9

Hiện đang cố gắng xây dựng android-5.1.0_r5. Tôi đã kiểm tra các nguồn và không sửa đổi. Tuy nhiên, khi biên dịch tôi nhận được lỗi sau.Lỗi thay đổi API khi xây dựng AOSP 5.1

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. 
****************************** 

Và các tệp công khai api khác thực sự cho thấy sự khác biệt.

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"; 

Tuy nhiên, tôi không thể tìm ra nơi các trường công bổ sung đó đến từ đâu. Bất kỳ ý tưởng?

Trả lời

4

Tôi thấy các mục trong mã r8 của mình để bạn có thể chạy an toàn, hãy cập nhật-api và khi kết thúc, hãy chạy lệnh make của bạn như bình thường.

9

Đừng làm 'make update-api' nếu bạn không chạm vào bất kỳ thứ gì. Có thêm apis đến form framework/base/res/AndroidManifest.xml được phân tích cú pháp bởi aapt sử dụng hệ thống lỗi/core/libcore/String8.cpp @@ removeAll() chúng sử dụng memcpy nhưng nên ghi nhớ các chuỗi chồng chéo trong bộ nhớ.

Đây là sự cố trên các máy xây dựng Debian (sid) hoặc Ubuntu (16 có thể 15) mới nhất. Đó là lỗi của google trong libcore/String8.cpp. Khắc phục sự cố ở đây: https://android.googlesource.com/platform/system/core/+/dd060f01f68ee0e633e9cae24c4e565cda2032bd

Người đàn ông này đã tìm thấy nó (Michael Scott) và có thể một số người khác nữa. Đây là điều tra của anh ấy: https://plus.google.com/+hashcode0f/posts/URHo3hBmfHY

Tự mình lớn lên!

+0

> Đừng làm 'thực hiện cập nhật-api' nếu bạn không chạm vào bất kỳ thứ gì. Điều này có vẻ đúng. Nhưng tôi đang ở trên 6.0.1 M4B30Z. Nhưng trong dòng 434, nó đã là 'memmove (buf + đuôi, buf + index + skip, next - index - skip); ' Dường như có một lý do khác cho vấn đề này. –

Các vấn đề liên quan