Android 缺少 annotations.jar

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10061986/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 02:21:20  来源:igfitidea点击:

Missing annotations.jar

androidannotationsrevision

提问by Merve

I am trying to update my Android SDK Tools to 17 rev. and I updated usign SDK Tools but in Properties/library ;enter image description here

我正在尝试将我的 Android SDK 工具更新到 17 rev。我更新了使用 SDK Tools 但在 Properties/library 中;在此处输入图片说明

But the fact that in the support folder there is a annotations.jar already. What should I do to fix it?

但事实上,在支持文件夹中已经有一个 annotations.jar。我应该怎么做才能修复它?

采纳答案by Jose

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. After the install the error was gone (at least in my system)

我有同样的问题。我转到 eclipse 中的 SDK 管理器(窗口 --> Android SDK 管理器)并安装了位于 Extras 文件夹中的 Android 支持包。安装后错误消失了(至少在我的系统中)

回答by xoxol_89

So, when i updated sdk to L version i had same problem. But after Extra folders updating in SDK Manager i didn't find annotation.jar file. Maybe Google bug with new SDK version. So i copied annotation.jar file from old SDK folder (folder half a year ago)

所以,当我将 sdk 更新到 L 版本时,我遇到了同样的问题。但是在 SDK 管理器中更新额外文件夹后,我没有找到 annotation.jar 文件。可能是新 SDK 版本的 Google 错误。所以我从旧的 SDK 文件夹(半年前的文件夹)复制了 annotation.jar 文件

回答by Vlad

Right click onto your project, in context menu choose Properties, your will see a window. Second line is Android - click onto it. You will see list of installed SDK. Check any SDK which has API level 16 or more.

右键单击您的项目,在上下文菜单中选择“属性”,您将看到一个窗口。第二行是 Android - 点击它。您将看到已安装 SDK 的列表。检查具有 API 级别 16 或更高级别的任何 SDK。

annotationas.jar is embedded in SDK of 16 API level and after it.

annotationas.jar 嵌入在 16 个 API 级别及之后的 SDK 中。

回答by I'm_With_Stupid

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

回答by Armin Mustafa

After updating all of the packages in the SDK manager you may need to update Android Developer toolkit also. Eclipse-> Help-> Check Updates-> Install

更新 SDK 管理器中的所有包后,您可能还需要更新 Android Developer 工具包。Eclipse->帮助->检查更新->安装

回答by S.Thiongane

I think Google has changed the location of that jar file from <SDK_DIR>/extras/android/support/annotations.jarto <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 -> LibrayTab,
  • then Add External Jars
  • Chose file from the given location above.
  • 刚刚从Java Build Path -> LibrayTab 中删除了文件,
  • 然后 Add External Jars
  • 从上面给定的位置选择文件。

回答by Josh1billion

I had this issue just now, and this was the top result in Google. Posting my results for time-traveling Googlers from the future.

我刚才有这个问题,这是谷歌的最高结果。发布我对来自未来的时间旅行 Google 员工的结果。

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”包,所以在过去两年内情况一定发生了变化。

Here's what did work for me: update allof the packages in the SDK manager.I don't know which update in particular fixed it, but now that they are all up-to-date, the problem is solved.

这对我有用:更新SDK 管理器中的所有包。我不知道哪个更新特别修复了它,但是现在它们都是最新的,问题解决了。