Android 使用或不使用eclipse调试res layout/xml错误
继安卓之后,我被要求在操作栏上添加一个按钮。自从有人告诉我 @drawable/后面的名称必须是保存在项目的res/drawable/目录中的位图图像的名称 在res下的任何drawable.+目录中,我既看不到drawable目录,也看不到任何默认的ic_action_search.png图像,我下载一些搜索按钮图像并将其放置在res下新创建的drawable目录下。然后更新res/menu/main.xml以指向新文件Android 使用或不使用eclipse调试res layout/xml错误,android,eclipse,ant,Android,Eclipse,Ant,继安卓之后,我被要求在操作栏上添加一个按钮。自从有人告诉我 @drawable/后面的名称必须是保存在项目的res/drawable/目录中的位图图像的名称 在res下的任何drawable.+目录中,我既看不到drawable目录,也看不到任何默认的ic_action_search.png图像,我下载一些搜索按钮图像并将其放置在res下新创建的drawable目录下。然后更新res/menu/main.xml以指向新文件 <item android:id="@+id/action_s
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"
android:showAsAction="ifRoom"/>
由于没有关于使用命令行工具构建最初通过eclipse创建的项目的说明,所以我四处搜索以找到需要运行的项目
android update project --target 1 --path .
我现在再次尝试ant debug,结果得到:
BUILD FAILED
/home/user/programs/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:601: Invalid file: eclipse_workspaces/android_dev/appcompat_v7/build.xml
Total time: 1 second
所以ant debug在我调用它的父目录appcompat_v7中创建了一个目录。显然,在我的xml文件中查找一个简单的bug时,我缺少了一些基本的东西
对于最初通过eclipse创建的android项目,我如何成功地使用命令行构建工具
或者
我如何从负责提供R变量的任何人那里获得有用的错误消息?关于您最初的问题-我认为用“android:src”属性替换“android:icon”应该可以解决它 关于创建ant构建文件-如果您的应用程序依赖于其他库项目appcompat_v7?-您还需要使用以下工具为这些文件创建build.xml文件: 'android更新库项目-目标-路径路径/到/您的/项目'
BUILD FAILED
/home/user/programs/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:601: Invalid file: eclipse_workspaces/android_dev/appcompat_v7/build.xml
Total time: 1 second