在Android Studio中添加全屏活动后生成错误

在Android Studio中添加全屏活动后生成错误,android,android-studio,Android,Android Studio,我正在Android Studio中试验我的第一个类似“Hello World”的应用程序。我尝试添加一个新的活动(首先通过new->Android组件,不喜欢结果,删除它,然后通过new->activity->selected Fullscreen activity)。现在我得到了这些错误: Gradle: Execution failed for task ':LanguagesMemorizer:processDebugResources'. > Could not call

我正在Android Studio中试验我的第一个类似“Hello World”的应用程序。我尝试添加一个新的活动(首先通过new->Android组件,不喜欢结果,删除它,然后通过new->activity->selected Fullscreen activity)。现在我得到了这些错误:

  Gradle: Execution failed for task ':LanguagesMemorizer:processDebugResources'.
  > Could not call IncrementalTask.taskAction() on task ':LanguagesMemorizer:processDebugResources'
  C:\...\src\main\res\values\attrs.xml
    Gradle: Attribute "buttonBarStyle" has already been defined
    Gradle: Attribute "buttonBarButtonStyle" has already been defined
我试着在我的项目中搜索buttonBarStyle。发现于:

  • 构建文件夹(我想我应该忽略它,不是吗?)
  • 新活动的布局文件(style=“?buttonBarStyle”)
  • values\attrs.xml本身(
  • values\styles.xml(
    ..@style/ButtonBar…
  • values-v11\styles.xml(
    ..?android:attr/buttonBarStyle…
所有这些都是自动生成的。我应该如何修复此错误

更新:attrs.xml中有一条评论说

<!-- Declare custom theme attributes that allow changing which styles are
         used for button bars depending on the API level.
         ?android:attr/buttonBarStyle is new as of API 11 so this is
         necessary to support previous API levels. -->


所以这些属性似乎是旧的Androids所需要的,但我猜API 11声明的属性和这些手动属性之间存在某种冲突。我该如何修理它们

这是因为
com.android.support:appcompat-v7:18.0.0
已经具有此属性。因此,如果您计划使用此支持库(您应该这样做),只需从您的项目中删除此属性的声明就可以了
\src\main\res\values\attrs.xml
。我猜,这种重复是因为AndroidStudio新建活动向导不认为您可以使用支持库,所以它会自行生成所有代码