簡體   English   中英

無法引用主android庫

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM