谷歌的Andr​​oid库code不能编译 [英] Google's Android repository code cannot be compiled

查看:276
本文介绍了谷歌的Andr​​oid库code不能编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从网上下载的Andr​​oid库的应用程序(日历)。

I downloaded an application (Calendar) from the Android repository.

我试图编译它,但它给我的错误。

I tried to compile it, but it gave me errors.

作为开发人员,有关存储库的第一条规则我学到的是:

As a developer, the first RULE about repositories I learned was this:

提交您的code。如果它可以没有错误进行编译。

在编译,我得到这些错误:

On compile, I get these errors:

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文件是从绘制包丢失。什么哟如意算盘:在这次提交检查

And really, the mentioned xml files are missing from the drawable package. What do yo reckon: was this commit checked?

我应该用什么来代替那些可绘制?颜色黑色?或颜色红?什么是解决这一问题的最佳方式是什么?

What should I use instead of those drawables? Color Black? Or Color Red? What is the best way to resolve this issue?

如果谷歌不符合标准的,谁都会?

If Google doesn't comply with standards, who will?

推荐答案

我想贾斯汀Jasman是在暗示< /一>是个人仓库组成Android源$ C ​​$ C的设计并不由自己签出和建造。他们设计建造为整个Android源代码树,这将拉动的依赖作为构建过程的一部分的一部分:

I think what Justin Jasman is hinting at is that the individual repositories that make up the Android source code aren't designed to be checked out and built by themselves. They’re designed to be built as part of the entire Android source tree, which will pull in dependencies as part of the build process:

AOSP:下载和构建

说了这么多,你可以通过在的 project.properties 文件。举例来说,接近这个文件的顶部,你会看到这一行:

Having said that, you can get some hints about any external dependencies by taking a look at the project.properties file. For instance, near the top of that file you’ll see this line:

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

这对应于平台/框架/ EX 库的位置。所以,如果你签出库:

Which corresponds to a location in the platform/frameworks/ex repository. So if you were to check out that repository:

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

和看在EX /芯片/ RES /文件夹的绘制,你会发现,这可能是有用的几个文件:

And look in the ex/chips/res/drawable folder, you’ll find a couple files that might prove useful:

list_item_font_primary.xml结果
list_item_font_secondary.xml

list_item_font_primary.xml
list_item_font_secondary.xml

复制这些文件到RES /绘将解决你列出的前两个错误。

Copying those files into res/drawable will fix the first two errors you listed.

同样,对于第三个错误,你会发现在为资源平台/框架的/ opt /的DateTimePicker 库。或者你可以只从更改值@色/白 @android:彩色/白结果
http://stackoverflow.com/a/3964048/399105

Similarly, regarding the third error, you'll find the resource for that in the platform/frameworks/opt/datetimepicker repository. Or you could just change the value from @color/white to @android:color/white
(http://stackoverflow.com/a/3964048/399105)

编辑:

我只注意到了Android源回购一些应用程序没有project.properties文件。在这种情况下,你可以看一下Android.mk文件,例如(从平台/封装/应用/彩信):

I just noticed some apps in the Android source repos don't have a project.properties file. In that case, you can just look at the Android.mk file, for example (from platform/packages/apps/Mms):

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

这篇关于谷歌的Andr​​oid库code不能编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆