简体   繁体   English

更新到ADT 23后无法找到annotations.jar

[英]Fail to find annotations.jar after updating to ADT 23

So, seeing that the new Android L is out, I said I should give it a try. 所以,看到新的Android L出来了,我说我应该试一试。 I installed the new ADT update from SDK tools and then from the updates. 我从SDK工具安装了新的ADT更新,然后从更新中安装。 After Eclipse restart, I get the error that Android Dependencies failed to load because \\android-sdk\\tools\\support\\annotations.jar cannot be found. Eclipse重启后,我收到Android Dependencies无法加载的错误,因为无法找到\\ android-sdk \\ tools \\ support \\ annotations.jar。

I checked the folder and it does not have the file. 我检查了文件夹,但没有文件。

Well, I said to myself that maybe the ADT update didn't go well so seeing that the new eclipse 4.4 is out I thought I could do a fresh install. 好吧,我对自己说,也许ADT更新不顺利所以看到新的日食4.4出来了我以为我可以做一个全新的安装。 So downloaded eclipse 4.4, installed the ADT tools and android sdk... and I get the same error. 所以下载了eclipse 4.4,安装了ADT工具和android sdk ......我得到了同样的错误。

Any ideas on how to fix this ? 有想法该怎么解决这个吗 ?

Uninstall/install Support library didn't help, so I did this: 卸载/安装支持库没有用,所以我这样做了:

Found ..\\android-sdk\\extras\\android\\support\\annotations\\android-support-annotations.jar and copied it to ..\\android-sdk\\tools\\support\\annotations.jar 找到..\\android-sdk\\extras\\android\\support\\annotations\\android-support-annotations.jar并将其复制到..\\android-sdk\\tools\\support\\annotations.jar

The problem is gone since then. 从那以后问题就消失了。 Doesn't look as incredibly awesome solution but at least now I can build my project in Eclipse. 看起来不是非常棒的解决方案,但至少现在我可以在Eclipse中构建我的项目。

A temporary solution from someone at google has been posted on the issue tracker: http://code.google.com/p/android/issues/detail?id=72419#c12 谷歌某人的临时解决方案已发布在问题跟踪器上: http//code.google.com/p/android/issues/detail? id = 72419#c12

Please wait for an updated version within a day or two. 请在一两天内等待更新版本。 Until then, your workaround is to do download one of: 在此之前,您的解决方法是下载以下其中一个:

and copy over the following files: 并复制以下文件:

  • tools/hprof-conv 工具/ HPROF-CONV
  • tools/support/annotations.jar 工具/支持/ annotations.jar
  • tools/proguard 工具/ proguard的

右键单击您的项目 - > project.properties - > target=android-19

Tomorrow I had the same problem after the update to ADT 23. 明天我在ADT 23更新后遇到了同样的问题。

The problem is related to the annotations. 问题与注释有关。

There are two libraries with annotations in the Android SDK: Android SDK中有两个带注释的库:

android-sdk/extras/android/support/annotations/android-support-annotations.jar Android的SDK /演员/安卓/支持/注释/ Android的支持,annotations.jar

this package contains: 这个包包含:

  • AnimRes AnimRes
  • AnimatorRes AnimatorRes
  • AnyRes AnyRes
  • ArrayRes ArrayRes
  • AttrRes AttrRes
  • BoolRes BoolRes
  • ColorRes ColorRes
  • DimenRes DimenRes
  • DrawableRes DrawableRes
  • FractionRes FractionRes
  • IdRes IdRes
  • IntDef IntDef
  • IntegerRes IntegerRes
  • InterpolatorRes InterpolatorRes
  • LayoutRes LayoutRes
  • MenuRes MenuRes
  • NonNull 非空
  • Nullable 可空
  • PluralsRes PluralsRes
  • RawRes RawRes
  • StringDef StringDef
  • StringRes StringRes
  • StyleRes StyleRes
  • StyleableRes StyleableRes
  • XmlRes XmlRes

and

android-sdk/tools/support/annotations.jar Android的SDK /工具/支持/ annotations.jar

that...with the new ADT update, for some reason disappeared. 那......随着新的ADT更新,出于某种原因消失了。

This package contains the two annotations (probably the most used :-)): 这个包包含两个注释(可能是最常用的:-)):

  • SupportLint SupportLint
  • TargetApi TargetApi

Without them, if your code (or dependencies use them) Eclipse will complain. 没有它们,如果您的代码(或依赖项使用它们),Eclipse会抱怨。

To fix this problem, we need the previous annotation.jar . 要解决此问题,我们需要先前的annotation.jar

So I downloaded the file from the link suggested by @aarati: 所以我从@aarati建议的链接下载了该文件:

http://central.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar http://central.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar

Renamed it in annotation.jar and moved to: android-sdk/tools/support/ annotation.jar重命名并移至: android-sdk / tools / support /

Restarting Eclipse everything will be fine. 重启Eclipse一切都会好的。

On Eclipse - After updating ADT or Updating Google SDK version, we find problem for the existing version of Google Play Service Lib. 在Eclipse上 - 更新ADT或更新Google SDK版本后,我们发现现有版本的Google Play Service Lib存在问题。

From the help of Above answers and other search, found the following way to correct it. 在上述答案和其他搜索的帮助下,找到以下方法来纠正它。

From Project menu of Eclipse, uncheck 'Build Automatically' 从Eclipse的Project菜单中,取消选中'自动构建'

1) Delete the existing lib project of 'google-play-services_lib'. 1)删除'google-play-services_lib'的现有lib项目。

2) Eclipse Menu --> File --> Import --> 'Existing Android Code Into Workspace' 2)Eclipse菜单 - >文件 - >导入 - >'现有Android代码进入工作区'

select the project from 'android-sdk\\extras\\google\\google_play_services\\libproject\\google-play-services_lib' 从'android-sdk \\ extras \\ google \\ google_play_services \\ libproject \\ google-play-services_lib'中选择项目

3) Select the same project by checkbox in 'Project to Import' 3)通过“要导入的项目”中的复选框选择相同的项目

4) Also check 'Copy projects into workspace' 4)同时选中“将项目复制到工作区”

5) When the project appears in 'package explorer', right click on it and select Properties. 5)当项目出现在“包浏览器”中时,右键单击它并选择“属性”。

Select 'Android' 选择“Android”

( as solution of 'Gavin Chen' ) - select the latest platform and Api level for this library project and click OK to close properties (作为'Gavin Chen'的解决方案) - 选择此库项目的最新平台和Api级别,然后单击确定关闭属性

5) again right click on same lib project from 'Package Explorer', click on 'Build project' 5)再次右键单击“Package Explorer”中的同一个lib项目,单击“Build project”

Now you will find the Google Play Service Library is built properly. 现在,您会发现Google Play服务库已正确构建。

Then you may build your other projects, which are dependent on it. 然后你可以建立你的其他项目,这取决于它。 You may also need to 'Remove' and 'Add' the google-play-service_lib, from your project -- properties -- Android -- Library. 您可能还需要从项目中删除“添加”和“添加”google-play-service_lib - 属性 - Android - Library。

You may re select 'Build Automatically' option from 'Project' Menu. 您可以从“项目”菜单中选择“自动构建”选项。

If you use build.gradle script, then just set the "compileSdkVersion" to 19. 如果使用build.gradle脚本,则只需将“compileSdkVersion”设置为19。

... android { ...... android {

compileSdkVersion 19
buildToolsVersion "19.1.0"

sourceSets {

... ...

You have to Update your ADT to the Latest Version! 您必须将ADT更新到最新版本!

In Eclipse go to Help 在Eclipse中转到帮助

Install New Software ---> Add 安装新软件--->添加

inside Add Repository write: 在Add Repository里面写:

https://dl-ssl.google.com/android/eclipse/ https://dl-ssl.google.com/android/eclipse/

Double click in the opening Box the 1 entry. 双击打开框中的1条目。

Follow the Eclipse instructions. 遵循Eclipse说明。

After loading some time you will get the newest Developer Tools and NDK Plugins 加载一段时间后,您将获得最新的开发人员工具和NDK插件

Repeat this for 2 times 重复2次

Tom 汤姆

I have already answered it here : https://stackoverflow.com/a/25785428/2178259 我已在这里回答: https//stackoverflow.com/a/25785428/2178259

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. 选择上面给定位置的文件。

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

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