1
我試圖導入ActionBarSherlock(ABS),到我用搖籃Android應用程序,但不幸的是,建築時,我得到的錯誤清單說:如何在Android應用程序中使用Gradle導入ActionBarSherlock?
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:248: error: Attribute "titleTextStyle" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:250: error: Attribute "subtitleTextStyle" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:256: error: Attribute "divider" has already been defined
/Users/kramer65/dev/repos/android-official/OurPackage/build/res/all/debug/values/values.xml:258: error: Attribute "background" has already been defined
[etc. etc.]
* What went wrong:
Execution failed for task ':processDebugResources'.
> Could not call IncrementalTask.taskAction() on task ':processDebugResources'
我嘗試使用下面的進口ABS 的build.gradle:
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:[email protected]'
compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.android.gms:play-services:4.0.30'
instrumentTestCompile(files('libs/espresso-1.0-SNAPSHOT-bundled.jar'))
}
,並在我的settings.gradle我有以下行:
include ':OurPackage', ':Libraries:ActionBarSherlock'
有人知道我在做什麼錯嗎?歡迎所有提示!
從settings.gradle中刪除':Libraries:ActionBarSherlock' 在build.gradle中編譯'com.actionbarsherlock:actionbarsherlock:[email protected]'就足夠了 – vandzi