Eclipse:新更新后xml图形布局出错

时间:2014-03-12 07:08:40

标签: android xml eclipse android-layout android-sdk-tools

我更新了Android工具等:

  • SDK Manager
  • help->检查更新
  • 帮助 - >安装新软件......

实际上,在创建活动时,片段现在包含了改进。

我在每个xml enter image description here

的每个图形布局中都出现此错误

错误日志:enter image description here

我添加了layoutlib-api-22.4.2.jar添加到项目中的构建路径但没有工作!

如何解决这个问题?

提前致谢

3 个答案:

答案 0 :(得分:1)

新的更新存在很多问题 简单的方法是从命令行创建项目,然后将其导入eclipse以执行此操作:

  1. 转到sdk文件夹,例如我的(包含android执行文件夹):

    $ cd Program / android / adt / sdk / tools /

  2. 获取目标列表:

    $ ./android list

    可用的Android目标:

    id:1或" android-7"      名称:Android 2.1 ...

  3. 选择该列表中的一个目标并将id放入此命令以创建android项目:

    $ ./android create project --target 24 --name MyFirstApp --path MyFirstApp --activity Main --package com.mrg.myfirstapp

  4. 然后它为你做了。现在在eclipse中右键单击项目资源管理器: enter image description here

  5. 5.选择此项:

    enter image description here

    6.如果需要,重命名项目名称,然后按“完成”

    enter image description here

    然后它可能会起作用

答案 1 :(得分:1)

哦,只需更改位于右上角的布局时使用的Android版本,即可避免此问题:)enter image description here 现在我没有收到任何错误! :)

答案 2 :(得分:0)

尝试安装ADT插件

  1. 启动Eclipse,然后选择“帮助”>安装新软件。
  2. 点击右上角的添加。
  3. 在显示的“添加存储库”对话框中,输入" ADT插件"对于名称和位置的以下网址:https://dl-ssl.google.com/android/eclipse/
  4. 点击OK然后继续:) 所有说明都可以在指南Install plugin
  5. 中找到