【发布时间】:2013-11-19 19:58:44
【问题描述】:
我只是用 android studio 创建了一个新项目,并根据usage documentation for ActionbarSherlock 在我的 build.gradle 中添加了这两行。
我的 build.gradle 看起来像这样:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 18
buildToolsVersion "18.1.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 18
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:18.0.+'
}
当我尝试编译时,出现以下错误:
Compilation completed with 75 errors and 0 warnings in 14 sec
/Users/anthony/android/TestProject/Testqirc/build/exploded-
bundles/ComAndroidSupportAppcompatV71800.aar/res/values/values.xml
Gradle: Attribute "titleTextStyle" has already been defined
....
....
Gradle: Attribute "activityChooserViewStyle" has already been defined
将dependencies 更改为
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:18.0.+'
}
我收到此错误:
Gradle:检索项目的父项时出错:找不到资源 匹配给定名称“Theme.AppCompat.Light.DarkActionBar”。
【问题讨论】:
-
您应该使用 ABS 或 appcompat。关于最后一个错误 - 看起来你从 appcompat 扩展了一些主题,或者尝试干净重新构建
标签: android actionbarsherlock android-studio