55

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 ?

Alin
  • 14,809
  • 40
  • 129
  • 218
  • http://code.google.com/p/android/issues/detail?id=72419 – Kyle Ivey Jun 27 '14 at 00:40
  • https://code.google.com/p/android/issues/detail?id=72493 – Pang Jun 27 '14 at 08:51
  • 1
    I'm happy to upload annotations.jar from my work PC which had rev 22. This fixed my eclipse workspace on my laptop which I had updated to rev 23. I think this is the only option right now until we wait for google to release an update. – RED_ Jun 27 '14 at 08:59
  • I wrote a short blog post about how to fix the issue in the most general sense because some can upgrade with problems and some just can't http://android-know-how-to.blogspot.co.il/2014/06/upgrading-to-adt-23-multiple-issues.html – TacB0sS Jul 02 '14 at 19:31

9 Answers9

33

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.

Sufian
  • 6,405
  • 16
  • 66
  • 120
user2967137
  • 330
  • 1
  • 2
  • 5
  • 3
    same here, found it on a backup but it is only 2 Kb, android-support-annotations.jar is around 12. There is also http://mvnrepository.com/artifact/com.google.android/annotations/4.1.1.4 which one? – nLL Jun 26 '14 at 22:17
  • Didn't work for me so tried the solution given by @Gavin Chen worked for me. – TheDevMan Jun 27 '14 at 09:40
  • i have the same problem with zipalign now .. some solutions ? – baroni Jun 30 '14 at 13:47
  • In my case, i just copied ..\android-sdk\extras\android\support\annotations\android-support-annotations.jar to my project/libs. its worked – Yohanim Sep 09 '14 at 02:33
19

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:

and copy over the following files:

  • tools/hprof-conv
  • tools/support/annotations.jar
  • tools/proguard
Kyle Ivey
  • 5,992
  • 1
  • 23
  • 35
  • +1 They have fixed the bug now. I had problem with annotations.jar and now it's gone. :) – Sufian Jul 01 '14 at 07:19
  • 1
    So apparently when upgrading to sdk 23, the sdk manager will still download the broken version. Have to run the update twice to get the fixed version! That took a while to figure out :) – Jay Aug 21 '14 at 00:47
13

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

famousgarkin
  • 13,687
  • 5
  • 58
  • 74
GavinCT
  • 129
  • 5
8

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.

Luca Sepe
  • 2,435
  • 1
  • 20
  • 26
  • Glad to help! @xaragen this morning I was in panic mode..since I had to release the app..bad idea doing the update..before :-) – Luca Sepe Jun 27 '14 at 16:24
1

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

aarati
  • 87
  • 8
  • Is that form the latest build tools? I ported mine over from my Work PC which has annotations.jar from the rev 22. – RED_ Jun 27 '14 at 08:57
  • i didn't have any stored version for reference so can't say for surely.At http://central.maven.org/maven2/com/google/android/annotations/ I do not see any other folders, that makes me feel its the latest. My facebook SDK project compiled fine once I included it – aarati Jun 27 '14 at 18:03
0

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'

3) Select the same project by checkbox in 'Project to Import'

4) Also check 'Copy projects into workspace'

5) 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

5) 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.

SHS
  • 1,414
  • 4
  • 26
  • 43
0

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

... android {

compileSdkVersion 19
buildToolsVersion "19.1.0"

sourceSets {

...

0

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

Ingo
  • 5,239
  • 1
  • 30
  • 24
0

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.
Community
  • 1
  • 1
S.Thiongane
  • 6,883
  • 3
  • 37
  • 52