与Android的ActionBarSherlock工作室应用程序兼容性冲突 [英] Android Studio Appcompat conflict with ActionBarSherlock
问题描述
我尝试导入Eclipse项目到Android工作室,并得到这个错误
i try import eclipse project to android studio and get this error
Error:(1) Attribute "titleTextStyle" has already been defined
Error:(1) Attribute "subtitleTextStyle" has already been defined
Error:(1) Attribute "divider" has already been defined
Error:(1) Attribute "background" has already been defined
Error:(1) Attribute "backgroundSplit" has already been defined
Error:(1) Attribute "navigationMode" has already been defined
Error:(1) Attribute "displayOptions" has already been defined
Error:(1) Attribute "title" has already been defined
Error:(1) Attribute "subtitle" has already been defined
Error:(1) Attribute "icon" has already been defined
和我弄明白appcombat是actionbarsherlock冲突。我试图从ABS迁移到appcombat但。看来我得到这个项目是很难$ C $光盘actionbarsherlock。所以其IMPOSIBLE我。我决定排除appcombat所以没有冲突的actionbarsherlock工作。
and i figure it out appcombat is conflict with actionbarsherlock. i try to migrate from abs to appcombat but. seems the project i got is hardcoded with actionbarsherlock. so its imposible for me. i decide to exclude the appcombat so the actionbarsherlock work without conflict.
这是我的gradle这个
here's my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "org.myapps.android"
minSdkVersion 9
targetSdkVersion 17
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_5
targetCompatibility JavaVersion.VERSION_1_5
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':menudrawer')
compile project(':actionbarsherlock')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/httpmime-4.1.2.jar')
compile files('libs/tagsoup-1.2.1.jar')
compile files('libs/volley.jar')
compile files('libs/wordpresscom-android-rest-v0.0.3.jar')
}
其位oldy项目,但它的一切我所需要的。在这些gradle这个。我没有看到的appcombat depencies。因此,如何从Android工作室排除appcombat?
its bit oldy project, but its all i need. in these gradle. i dont see the appcombat depencies. so how to exclude appcombat from android studio?
推荐答案
ActionBarSherlock是 [DE preCATED]
ActionBarSherlock was [DEPRECATED]
从项目中删除ActionBarSherlock和使用应用程序兼容性库有动作条上的旧版本。
remove ActionBarSherlock from your project and use Appcompat library to have actionBar on old versions.
应用程序兼容性用法:
在您的摇篮文件中加入:
in your Gradle file add:
compile 'com.android.support:appcompat-v7:23.0.1'
在设置应用程序兼容性作为父主题风格文件:
in style file set appcompat as your parent theme:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
从AppCompatActivity程度的活动:
extent your activity from AppCompatActivity:
public class MainActivity extends AppCompatActivity
这篇关于与Android的ActionBarSherlock工作室应用程序兼容性冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!