2015-01-12 105 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

    相关问题