Fail to find annotations.jar after updating to ADT 23

AndroidEclipseAdt

Android Problem Overview


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 ?

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

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

Solution 3 - Android

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

Solution 4 - Android

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.

Solution 5 - Android

Solution 6 - Android

On Eclipse - After updating ADT or Updating Google SDK version, we find problem for the existing version of 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'

  1. Delete the existing lib project of 'google-play-services_lib'.

  2. Eclipse Menu --> File --> Import --> 'Existing Android Code Into Workspace'

select the project from 'android-sdk\extras\google\google_play_services\libproject\google-play-services_lib'

  1. Select the same project by checkbox in 'Project to Import'

  2. Also check 'Copy projects into workspace'

  3. When the project appears in 'package explorer', right click on it and select Properties.

Select 'Android'

( as solution of 'Gavin Chen' ) - select the latest platform and Api level for this library project and click OK to close properties

  1. again right click on same lib project from 'Package Explorer', click on 'Build project'

Now you will find the Google Play Service Library is built properly.

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.

You may re select 'Build Automatically' option from 'Project' Menu.

Solution 7 - Android

If you use build.gradle script, then just set the "compileSdkVersion" to 19.

... android {

compileSdkVersion 19
buildToolsVersion "19.1.0"

sourceSets {

...

Solution 8 - Android

You have to Update your ADT to the Latest Version!

In Eclipse go to Help

Install New Software ---> Add

inside Add Repository write:

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

Double click in the opening Box the 1 entry.

Follow the Eclipse instructions.

After loading some time you will get the newest Developer Tools and NDK Plugins

Repeat this for 2 times

Tom

Solution 9 - Android

I have already answered it here : 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 > >To solve this issue, I followed these steps on all projects and libraries in my workspace using this jar: > >- Just removed the file from Java Build Path -> Libray Tab, >- then Add External Jars >- Chose file from the given location above.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlinView Question on Stackoverflow
Solution 1 - Androiduser2967137View Answer on Stackoverflow
Solution 2 - AndroidKyle IveyView Answer on Stackoverflow
Solution 3 - AndroidGavinCTView Answer on Stackoverflow
Solution 4 - AndroidLuca SepeView Answer on Stackoverflow
Solution 5 - AndroidaaratiView Answer on Stackoverflow
Solution 6 - AndroidSHSView Answer on Stackoverflow
Solution 7 - Androiduser3790477View Answer on Stackoverflow
Solution 8 - AndroidIngoView Answer on Stackoverflow
Solution 9 - AndroidS.ThionganeView Answer on Stackoverflow