2015-01-12 102 views
1

enter image description here我正在使用eclipse juno,當我創建新應用程序時,它包含錯誤。 我正在經歷以下解決方案,但仍然存在錯誤。 1.清潔和構建應用程序 2.增加了appcompat_v7庫 請幫我解決這個錯誤[我已經加入和清理項目,但仍是錯誤在那裏] [2] [2]:!eclipse中創建新應用程序時出現appcompat_v7庫錯誤

+0

您需要在您的項目中使用appcompact庫引用嗎? – Anjali

+0

不,它在那裏! –

+0

做一個項目>清潔。如果錯誤仍然存​​在,則顯示找不到什麼資源(從截圖中無法看出)。 –

回答

4

請遵醫囑:

  1. 從項目中刪除appcompat_v7 library庫。你會在你的主項目中發現一些錯誤。

  2. 您會在values文件夾中的styles文件中發現錯誤。

(I)應用的代碼的以下各行中的values文件夾的styles.xml其中包含錯誤:

<resources> 

    <!-- 
     Base application theme for API 11+. This theme completely replaces 
     AppBaseTheme from res/values/styles.xml on API 11+ devices. 
    --> 
    <style name="AppBaseTheme" parent="android:Theme.Light"> 
     <!-- API 11 theme customizations can go here. --> 
    </style> 

</resources> 

(ii)以styles.xml應用values-v11文件夾的這些:

<resources> 

     <!-- 
      Base application theme for API 11+. This theme completely replaces 
      AppBaseTheme from res/values/styles.xml on API 11+ devices. 
     --> 
     <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> 
      <!-- API 11 theme customizations can go here. --> 
     </style> 

    </resources> 

(iii)將這些應用於values-v14styles.xml文件夾中:

<resources> 

      <!-- 
       Base application theme for API 11+. This theme completely replaces 
       AppBaseTheme from res/values/styles.xml on API 11+ devices. 
      --> 
      <style name="AppBaseTheme" parent="android:Theme.Holo.Light"> 
       <!-- API 11 theme customizations can go here. --> 
      </style> 

     </resources> 
  • menu內的文件夾,具有android:showAsAction="never"

  • 最後在MainActivity替換app:showAsAction="never"Activity替換ActionBarActivity。刪除所有不必要的輸入。

  • 現在希望您的項目已經準備好運行。

    0

    這可能是因爲您沒有正確添加appcompact_v7支持jar文件到您的項目中。請檢查此鏈接How to add support libraries?將會有幫助。添加jar文件後忘記重新啓動您的eclipse。

    1)將您的支持庫添加到您的項目瀏覽器。 2)添加jar文件到你的android項目,如上面的鏈接建議。 3)清理並建立你的項目(或重啓eclipse)。

    +0

    我已經添加appcompat_v7庫,但錯誤仍然存​​在。 –

    +0

    使用API​​18編譯並在其中添加支持庫。這可能適用... – Miller

    +0

    圖片顯示您的支持庫還包含錯誤?你可以請清理它,並請報告是否存在任何錯誤 – Miller

    相關問題