“错误:属性”样式“已经定义”从Maven添加facebook sdk后出错“

时间:2014-12-07 08:44:35

标签: android facebook maven gradle android-studio

我通过maven以下列方式添加了facebook SDK:

compile 'com.facebook.android:facebook-android-sdk:3.21.1'

编译时,我在\app\src\main\res\values\colors.xml文件中收到错误

Error:Attribute "style" has already been defined

有什么建议吗?这非常令人费解。

摇篮:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.1'
    defaultConfig {
        applicationId 'com.rayat.pricewiz'
        minSdkVersion 17
        targetSdkVersion 21
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile files('libs/androidmvcframework.jar')
    compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar')
    compile files('libs/universal-image-loader-1.9.2.jar')
    // You must install or update the Google Repository through the SDK manager to use this dependency.
    // You must install or update the Google Repository through the SDK manager to use this dependency.
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.google.android.gms:play-services:6.1.71'
    compile 'com.android.support:appcompat-v7:21.0.0'
    compile 'com.android.support:recyclerview-v7:+'
    compile files('libs/CWAC-SackOfViewsAdapter.jar')
    compile 'com.daimajia.swipelayout:library:1.1.7@aar'
    compile 'com.facebook.android:facebook-android-sdk:3.21.1'
}

我的colors.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>
    <color name="red">#FF0000</color>
    <color name="transparent">#00000000</color>
    <color name="gray">#808080</color>
    <color name="grey">#CDCDCD</color>
    <color name="grey_dark">#5D5D5D</color>
    <color name="blue_light">#69b5ec</color>
    <color name="blue">#10a3d9</color>
    <color name="blue_dark">#295496</color>
    <color name="orange">#ed8305</color>
    <color name="orange_light">#F7BB31</color>
    <color name="logo_green">#46B525</color>
    <color name="green_menu">#0F6A15</color>
    <color name="orange_semi_transparent">#DC46B525</color>
    <color name="actionbar_text">#FFFFFF</color>
    <color name="black_overlay">#66000000</color>
    <color name="grey_border">#DDDDDD</color>
    <color name="navy_blue">#1A0DAB</color>
    <color name="background_tab_pressed">#6633B5E5</color>
    <color name="dark_grey">#808080</color>
    <color name="btn_unselected_grey">#FAFAFA</color>
    <color name="btn_unselected_grey_border">#EEEFF0</color>
    <color name="follow_unselected">#5D5D5D</color>
    <color name="bag_orange">#F7BB31</color>
    <color name="hint_color">#66000000</color>
    <color name="light_header_grey">#F1F1F1</color>
    <color name="grey_header_text">#5A5A5A</color>
    <color name="btn_pressed_color">#b3dae8</color>
    <color name="fragment_seperator">#e5e5e5</color>
    <color name="view_ontouch_color">#69B5EC</color>
</resources>

谢谢,

Noorul

1 个答案:

答案 0 :(得分:14)

Facebook SDK有一个名为&#34; style&#34;在我看来,它似乎与JazzyViewPager中的相同属性名称相冲突

打开构建目录中的中间文件,然后搜索&#34; name = style&#34;找出问题的起源

gradle错误将显示带有中间文件名

的命令行