Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. I installed the new ADT update from SDK tools and then from the updates. After Eclipse restart, I get the error that Android Dependencies failed to load because \android-sdk\tools\support\annotations.jar cannot be found.

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. So downloaded eclipse 4.4, installed the ADT tools and android sdk... and I get the same error.

Any ideas on how to fix this ?

like image 506
Alin Avatar asked Jun 26 '14 19:06

Alin


5 Answers

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

The problem is gone since then. Doesn't look as incredibly awesome solution but at least now I can build my project in Eclipse.

like image 176
user2967137 Avatar answered Oct 02 '22 09:10

user2967137


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

Please wait for an updated version within a day or two. Until then, your workaround is to do download one of:

  • http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz
  • http://dl.google.com/android/android-sdk_r22.6.2-windows.zip
  • http://dl.google.com/android/android-sdk_r22.6.2-macosx.zip

and copy over the following files:

  • tools/hprof-conv
  • tools/support/annotations.jar
  • tools/proguard
like image 43
Kyle Ivey Avatar answered Oct 01 '22 09:10

Kyle Ivey


Right click on your project --> project.properties --> target=android-19

like image 30
GavinCT Avatar answered Oct 01 '22 09:10

GavinCT


Tomorrow I had the same problem after the update to ADT 23.

The problem is related to the annotations.

There are two libraries with annotations in the Android SDK:

android-sdk/extras/android/support/annotations/android-support-annotations.jar

this package contains:

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

and

android-sdk/tools/support/annotations.jar

that...with the new ADT update, for some reason disappeared.

This package contains the two annotations (probably the most used :-)):

  • SupportLint
  • TargetApi

Without them, if your code (or dependencies use them) Eclipse will complain.

To fix this problem, we need the previous annotation.jar.

So I downloaded the file from the link suggested by @aarati:

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/

Restarting Eclipse everything will be fine.

like image 23
Luca Sepe Avatar answered Oct 02 '22 09:10

Luca Sepe


Adding http://central.maven.org/maven2/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar as annotations.jar resolved my errors

like image 26
aarati Avatar answered Oct 03 '22 09:10

aarati