我正在尝试将 ActionBarSherlock 添加到我现有的应用程序中。这并不像我想象的那么容易。我已经这样做了两天了。我已经为 2 页的 Google 结果尝试了每个教程。这是我遵循本教程后的内容。
我的项目结构
ActionBarSherlock/actionbarsherlock/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android-library'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/Parse-1.3.1.jar')
}
android {
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
ClashMMAProject/ClashMMA/build.gradle
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.android.support:support-v4:13.0.+'
compile files('libs/Parse-1.3.1.jar')
compile project(':libraries:ActionBarSherlock:actionbarsherlock')
}
android {
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
设置.gradle
include ':ClashMMA', ':libraries:ActionBarSherlock:actionbarsherlock'
依赖项
我的错误
我做了很多研究,但我什么也做不了。我每次都会出错,所以有些东西我理解不正确。请帮忙。谢谢你的时间。
更新
好的建议后,这就是我在 ClashMMAProject/ClashMMA/build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
compile 'com.android.support:support-v4:18.0.+'
compile files('libs/Parse-1.3.1.jar')
}
android {
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
}
android {
compileSdkVersion 17
buildToolsVersion "18.0.1"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
这会产生错误:
Gradle: Execution failed for task ':ClashMMA:processDebugManifest'.
> Manifest merging failed. See console for more info.