[英]Cannot reference main android Library
在更新到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,并且当我尝试添加另一个库时,添加库下拉菜单显示为灰色,无法选择。 所以我不太确定在这里做什么,我完全不知所措。
几天前我也遇到了同样的问题,
我通过将sdk更新到最新版本23.0.4解决了相同的问题。 其他:Android支持版本库。 6 Android支持库进行修订。 20
首先,从eclipse打开您的Android sdk管理器,然后下载所有最新的sdk更新和额外下载。
然后,在下载所有更新后,您需要使用新的Eclips编辑器,因为现有的Eclipse无法让您成功地从Android sdk工具20更新到21.0.4,然后使用新的eclips编辑器并在其中设置更新的android sdk路径新鲜的食(您在上一个食编辑器中使用过的食,您可以在Window >> Prefrences >> Android中找到它)。
希望这可以解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.