简体   繁体   English

缺少注释.jar

[英]Missing annotations.jar

I am trying to update my Android SDK Tools to 17 rev.我正在尝试将我的 Android SDK 工具更新到 17 版本。 and I updated usign SDK Tools but in Properties/library;我更新了 usign SDK Tools 但在 Properties/library 中;在此处输入图像描述

But the fact that in the support folder there is a annotations.jar already.但事实是,在支持文件夹中已经有一个 annotations.jar。 What should I do to fix it?我应该怎么做才能解决它?

So, when i updated sdk to L version i had same problem.所以,当我将 sdk 更新到 L 版本时,我遇到了同样的问题。 But after Extra folders updating in SDK Manager i didn't find annotation.jar file.但是在 SDK 管理器中更新额外文件夹后,我没有找到 annotation.jar 文件。 Maybe Google bug with new SDK version.也许谷歌 bug 与新的 SDK 版本。 So i copied annotation.jar file from old SDK folder (folder half a year ago)所以我从旧的 SDK 文件夹(半年前的文件夹)复制了 annotation.jar 文件

I had the same problem.我有同样的问题。 I went to the SDK Manager within eclipse (Window --> Android SDK Manager) and installed the Android Support package which is found in the Extras folder.我去了 eclipse 中的 SDK 管理器(窗口 --> Android SDK 管理器)并安装了 Android 支持 package,它位于 Extras 文件夹中。 After the install the error was gone (at least in my system)安装后错误消失了(至少在我的系统中)

Right click onto your project, in context menu choose Properties, your will see a window. Second line is Android - click onto it.右键单击您的项目,在上下文菜单中选择属性,您将看到 window。第二行是 Android - 单击它。 You will see list of installed SDK. Check any SDK which has API level 16 or more.您将看到已安装 SDK 的列表。检查任何具有 API 级别 16 或更高级别的 SDK。

annotationas.jar is embedded in SDK of 16 API level and after it. annotationas.jar 嵌入在 16 API 级别的 SDK 及其之后。

What worked for me was downloading the annotations.jar file, and then adding that to where it was supposed to be according to the error.对我有用的是下载 annotations.jar 文件,然后根据错误将其添加到应有的位置。

It can be downloaded here: http://mvnrepository.com/artifact/com.google.android/annotations/4.1.1.4可以在这里下载: http://mvnrepository.com/artifact/com.google.android/annotations/4.1.1.4

After updating all of the packages in the SDK manager you may need to update Android Developer toolkit also.更新 SDK 管理器中的所有包后,您可能还需要更新 Android 开发人员工具包。 Eclipse -> Help -> Check Updates -> Install Eclipse ->帮助->检查更新->安装

I think Google has changed the location of that jar file from <SDK_DIR>/extras/android/support/annotations.jar to <SDK_DIR>/extras/android/support/annotations/android-support-annotations.jar我认为 Google 已将 jar 文件的位置从<SDK_DIR>/extras/android/support/annotations.jar<SDK_DIR>/extras/android/support/annotations/android-support-annotations.jar

To solve this issue, I followed these steps on all projects and libraries in my workspace using this jar:为了解决这个问题,我使用这个 jar 对我工作区中的所有项目和库执行了以下步骤:

  • Just removed the file from Java Build Path -> Libray Tab,刚刚从Java Build Path -> Libray Tab 中删除了文件,
  • then Add External Jars然后Add External Jars
  • Chose file from the given location above.从上面给定的位置选择文件。

I had this issue just now, and this was the top result in Google.我刚才遇到了这个问题,这是谷歌的最高结果。 Posting my results for time-traveling Googlers from the future.为来自未来的时间旅行的谷歌员工发布我的结果。

Jose's solution didn't work for me, as there was no "Extras" folder, nor "Android Support" package, in my update manager, so things must have changed within the past two years. Jose 的解决方案对我不起作用,因为在我的更新管理器中没有“Extras”文件夹,也没有“Android Support”package,所以过去两年内肯定发生了变化。

Here's what did work for me: update all of the packages in the SDK manager.以下是对我有用的方法:更新 SDK 管理器中的所有包。 I don't know which update in particular fixed it, but now that they are all up-to-date, the problem is solved.我不知道具体是哪个更新修复了它,但现在它们都是最新的,问题就解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM