简体   繁体   中英

Eclipse ADT for Android not working

I installed ADT on my Eclipse so I can develop Android apps. The issue is that every time I try to load the project, it shows lots of errors like these:

[2015-08-01 07:15:41 - AndroidApp1] C:\\Users\\Arad\\workspace\\appcompat_v7\\res\\values-v21\\themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'. [2015-08-01 07:15:41 - AndroidApp1]

[2015-08-01 07:15:41 - AndroidApp1]

C:\\Users\\Arad\\workspace\\appcompat_v7\\res\\values-v21\\themes_base.xml:146: error: Error: No resource found that matches the given name: attr 'android:windowElevation'. [2015-08-01 07:15:41 - AndroidApp1]

[2015-08-01 07:15:41 - AndroidApp1]

C:\\Users\\Arad\\workspace\\appcompat_v7\\res\\values-v21\\themes_base.xml:150: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.

[2015-08-01 07:15:41 - AndroidApp1]

I found a similar question where it said to remove Android Wear ARM EABI v7a System Image so I uninstalled it and tried but without success. Later, I uninstalled the whole API 22, but still nothing and now it shows errors about API 21. What can I do about it?

Here is one thing to do:

  1. After importing the library for appcompat-v7 right click and go to properties
  2. Click Android and change the Project Build Target to API 21
  3. Clean and rebuild

step 1 : 右键单击->属性

step 2 : 更改项目构建目标

This should fix the issue of not finding the resources, I believe.

You need to make sure that you have installed the correct libs from the SDK manager and you've included v7-appcompat as a library project. You have to do this because v7-appcompat contains resource files that unlike android studio, are not added automatically by ADT.

See accepted SO answer here for more: appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'

It's important to know that ADT is no longer supported. This means that it's no longer getting bug fixes or better support for newer features.

Relevant snippet from http://developer.android.com/tools/sdk/eclipse-adt.html

Google recommends switching to Android studio If you have been using Eclipse with ADT, be aware that Android Studio is now the official IDE for Android, so you should migrate to Android Studio to receive all the latest IDE updates. For help moving projects, see Migrating to Android Studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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