Fail to find annotations.jar after updating to ADT 23

前端 未结 9 1332
無奈伤痛
無奈伤痛 2020-12-05 12:52

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 ge

9条回答
  •  情话喂你
    2020-12-05 13:28

    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.

提交回复
热议问题