gpt4 book ai didi

android - 从 Maven 添加 facebook sdk 后出现 "Error:Attribute "样式 "has already been defined"错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:27:34 25 4
gpt4 key购买 nike

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

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

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

错误:属性“style”已被定义

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

Gradle :

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>

谢谢,

努鲁

最佳答案

Facebook SDK 有一个名为“style”的属性,在我的例子中,它似乎与 JazzyViewPager 中的相同属性名称冲突

打开build目录下的中间文件,搜索“name=style”,找出问题出处

gradle error会给你显示中间文件名的命令行

关于android - 从 Maven 添加 facebook sdk 后出现 "Error:Attribute "样式 "has already been defined"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27341073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com