无法引用主要的android库

时间:2014-10-13 02:24:15

标签: java android eclipse

我在更新到android API 20之后遇到了一些重大问题,在eclipse上创建一个新的android项目后,我被标记为大量公交车,如下所示

Description Resource    Path    Location    Type
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 8  Java Problem
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 12 Java Problem
ActionBarActivity cannot be resolved to a type  MainActivity.java   /testone/src/com/example/testone    line 32 Java Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.   styles.xml  /testone/res/values-v14 line 8  Android AAPT Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml  /testone/res/values line 7  Android AAPT Problem
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'. styles.xml  /testone/res/values-v11 line 7  Android AAPT Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 13 Java Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 19 Java Problem
R cannot be resolved to a variable  MainActivity.java   /testone/src/com/example/testone    line 29 Java Problem
The import android.support.v7 cannot be resolved    MainActivity.java   /testone/src/com/example/testone    line 3  Java Problem
The method getMenuInflater() is undefined for the type MainActivity MainActivity.java   /testone/src/com/example/testone    line 19 Java Problem
The method onCreate(Bundle) of type MainActivity must override or implement a supertype method  MainActivity.java   /testone/src/com/example/testone    line 11 Java Problem
The method onCreateOptionsMenu(Menu) of type MainActivity must override or implement a supertype method MainActivity.java   /testone/src/com/example/testone    line 17 Java Problem
The method onOptionsItemSelected(MenuItem) of type MainActivity must override or implement a supertype method   MainActivity.java   /testone/src/com/example/testone    line 24 Java Problem

我已经尝试过几种在网上找到的方法,但似乎没什么用。我试过:修复项目属性选项没有做任何事情,当我尝试手动添加库时,我发现appcompat_v7丢失,当我尝试添加另一个库时,添加库下拉菜单显示为灰色且无法选择。所以我不确定该怎么做,我完全失去了。

1 个答案:

答案 0 :(得分:1)

前几天我也遇到了同样的问题,

我通过将sdk更新到最新版本23.0.4解决了同样的问题。 和附加功能: Android支持Repository to rev。 6 Android支持库转。 20

首先从eclipse打开你的Android sdk Manager并下载所有最新的sdk更新和额外的下载。

然后在下载所有更新后,您需要使用新的Eclips编辑器,因为您现有的eclipse不会让您成功从Android sdk工具20更新到21.0.4 然后只需使用一个新的eclips编辑器并在新的eclips中设置更新的android sdk路径(你在上一个eclipse编辑器中使用的那个,你可以在Window>> Prefrences>> Android)找到它。

希望这可以解决您的问题。

相关问题