2014-05-25 14 views
1

我從Android repository下載了一個應用程序(日曆)。Google的Android存儲庫代碼無法編譯

我試圖編譯它,但它給了我錯誤。

作爲一名開發人員,有關存儲庫的第一條規則我的教訓是這樣的:

提交您的代碼,如果它沒有錯誤編譯。

在編譯,我得到這些錯誤:

Error:(38, -1) android-apt-compiler: [Calendar] C:\Dev\Calendar\res\layout\location_dropdown_item.xml:38: error: Error: No resource found that matches the given name (at 'textColor' with value '@drawable/list_item_font_primary'). 
Error:(46, -1) android-apt-compiler: [Calendar] C:\Dev\Calendar\res\layout\location_dropdown_item.xml:46: error: Error: No resource found that matches the given name (at 'textColor' with value '@drawable/list_item_font_secondary').  
Error:(44, -1) android-apt-compiler: [Calendar] C:\Dev\Calendar\res\layout\recurrencepicker.xml:44: error: Error: No resource found that matches the given name (at 'background' with value '@color/white'). 

真的,所提到的XML文件是從繪製包丟失。喲估計:這個提交檢查?

我應該用什麼來代替那些可繪製的?顏色黑色?或顏色紅?解決此問題的最佳方法是什麼?

如果Google不符合標準,誰會呢?

+0

此困境可能是部分結帳的結果。當我通過本地svn服務器檢出我的項目時,我的本地庫始終缺失。 –

+0

在網站上,它只顯示了這個Git鏈接,沒有提及其他的依賴:** git clone https://android.googlesource.com/platform/packages/apps/Calendar** – Nestor

+0

你是否已經將整個源代碼樹構建爲記錄? –

回答

2

我認爲Justin Jasman is hinting at是構成Android源代碼的單個存儲庫不是設計用於檢出並自行構建的。它們被設計用來建爲整個Android源代碼樹,這將依賴拉作爲構建過程的一部分的一部分:

AOSP: Downloading and Building

說了這麼多,你可以得到任何外部依賴一些提示通過看看project.properties文件。例如,靠近該文件的頂部,你會看到這樣一行:

android.library.reference.1=../../../frameworks/ex/chips 

相當於在platform/frameworks/ex倉庫的位置。所以,如果你簽出庫:

git clone https://android.googlesource.com/platform/frameworks/ex 

並期待在EX /芯片/ RES /繪製的文件夾,你會發現可能證明是有用的幾個文件:

list_item_font_primary.xml
list_item_font_secondary.xml

將這些文件複製到res/drawable將修復您列出的前兩個錯誤。

同樣,關於第三個錯誤,您可以在platform/frameworks/opt/datetimepicker存儲庫中找到該資源。或者你可以在值只是改變從@color/white@android:color/white
https://stackoverflow.com/a/3964048/399105

編輯:

我只是注意到了Android的源回購一些應用程序沒有project.properties文件。在這種情況下,您可以查看Android.mk文件,例如(從platform/packages/apps/Mms):

chips_dir := ../../../frameworks/ex/chips/res 
+0

謝謝,這是結帳過程的徹底解釋。 – Nestor