Android 红色感叹号

Android Exclamatory red mark

我是 Android 的新手。每当我使用新工作区创建新项目时,我的项目中的 Eclipse 中都会出现一个感叹号红色标记,并在 Appcompat 处出现错误。我在这里搜索了答案,但没有答案是我要找的,所以我只问了这个。当我在 DDMS 创建工作区时,它显示:

Sending Tracking request failed!

在 Android,我创建了一个新项目后

WARNING: unable to write jarlist cache file here, src file, layout file not available.

我搜索了很多,没有找到解决方案。

好的,首先。 Google 不再支持 Eclipse。 Android 开发的唯一官方 IDE 是 Android Studio Download Page.

这里是announcement Eclipse 支持结束

Over the past few years, our team has focused on improving the development experience for building Android apps with Android Studio. Since the launch of Android Studio, we have been impressed with the excitement and positive feedback. As the official Android IDE, Android Studio gives you access to a powerful and comprehensive suite of tools to evolve your app across Android platforms, whether it's on the phone, wrist, car or TV.

To that end and to focus all of our efforts on making Android Studio better and faster, we are ending development and official support for the Android Developer Tools (ADT) in Eclipse at the end of the year. This specifically includes the Eclipse ADT plugin and Android Ant build system.

请注意,使用 Eclipse 开发 Android 应用程序的人数正在下降。随着时间的推移,即使在 Whosebug 上,你得到的支持也会越来越少。总的来说,最好在刚开始的时候进行切换。

检查第一个 link,您会在 Android Studio IDE

中看到一些很棒的文档

如果您 100% 需要使用 Eclipse...

好的,您的工作需要 Eclipse 或其他原因,请查看 this documentation by Eclipse

另外,这里有一个list of all the different icons that can be displayed by Eclipse ().

Build path problems are sometimes easy to miss among other problems in a project. The Package Explorer and Project Explorer views now show a new decorator on Java projects and working sets that contain build path errors:

The concrete errors can be seen in the Problems view, and if you open the view menu and select Group By > Java Problem Type, they all show up in the Build Path category:

如果您在使用 app_compact 库时遇到任何问题...这就是解决方案

希望它能奏效....

也请参考这个linkhere

If you go to appcompat_v7/bin folder, you'll see that file "jarlist.cache" doesn´t appear or is unsynchronized. You need to refresh the appcompat_v7 folder, only press F5 over that folder.

appcompat_v7 文件夹已添加,因为您使用了操作栏 组件。

啊。为避免在创建新文件夹时出现新的 appcompat_v7_XX 文件夹 项目,选择 LEVEL API 14 作为 Minimun Required SDK。在你必须 修改 AndroidManifest.xml 并设置您需要的级别。

改变它 android:targetSdkVersion="19" />

删除所有 appcompat_v7_XX。这是一个错误。

使用appcompat_v7,你会看到Eclipse创建了两个XML文件: Activity_main.xml 和 fragment_main.xml。如果你想有一个选择 要仅使用 activity_main.xml 以旧方式创建项目,请执行 那:

复制位于此路径中的文件夹 "BlanckActivity": \sdk\tools\templates\activities ADT 以前的版本。

将文件夹重命名为“BlankActivityNoFragment”,然后编辑字段 文件名 "template.xml" 用记事本作为 name=”BlankActivityNoFragment”

复制新文件夹到新Eclipse同路径 IDE:sdk/tools/templates/activities

现在您在创建新项目时会看到新模板。 记得选择 Minimum Required SDK 一个 API 14

如果您不需要 appcompat 库的支持,只需按照以下步骤将其从您的项目中删除即可:

  1. 右键单击项目
  2. Select 属性
  3. 在对话框 select android 左侧
  4. 在对话框中检查库部分
  5. 通过 select 删除 appcompat 库并按删除
  6. 用 Activity
  7. 扩展你的 MainActivity.java

您可以运行您的项目成功。

如果您需要 appcompat 的支持,请按照以下步骤操作:

  1. 使用 Sdk Manager 下载最新的 appcompat
  2. 在您的 eclipse 中导入 appcompat 项目
  3. 将其添加为库项目
  4. 使用 AppCompatActivity 扩展您的 MainActivity。

根据 documentation

Decorates Java projects and working sets that contain build path errors

可能有多种原因。大多数时候可能是以下一些原因,

  1. 您已从 /lib 文件夹中删除了一些 .jar 文件
  2. 您添加了新的 .jar 文件
  3. 您添加了新的 .jar 文件,可能会与其他文件冲突

所以我们要做的是解决那些丢失/更新/newly_added jar 文件。

  • 右键单击项目并转到属性
  • Select Java 构建路径
  • 转到库选项卡
  • 删除您已经删除的jar 文件的引用。它们附近会有一个红色标记,因此您可以轻松识别它们。
  • 使用添加 JAR 刷新项目添加对新添加的 .jar 文件的引用

如果是上述原因之一,这将解决问题。

仍然面临问题??试试这个:

转到 Windows -> 首选项 -> Android -> 构建并取消选中 "Skip packaging and dexing until export or launch" 然后重新启动 Eclipse。