设计库和支持库

时间:2015-08-19 12:30:39

标签: java android android-studio android-appcompat

我想使用' com.android.support:design:22.2.0 '在我的Android Studio(1.3)项目中但是当我添加&com; android.support:design:22.2.0'依赖{}我得到103错误,我无法摆脱这个错误。

如果我尝试使用新版本的appcompat,也会发生同样的情况。我现在有 编译' com.android.support:appcompat-v7:19。+'在我的build.gradle中。

有人有任何想法吗?

我的错误:

Information:Gradle tasks [:generateDebugSources, :generateDebugAndroidTestSources]
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:prepareComAndroidSupportCardviewV72211Library UP-TO-DATE
:prepareComAndroidSupportDesign2220Library UP-TO-DATE
:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServices6111Library UP-TO-DATE
:preparePaketekBeaconEstimoteSdkUnspecifiedLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources
:processDebugManifest
:processDebugResources
/Users/matejl/Documents/AndroidStudio Projects/Paketek-beacon/build/intermediates/exploded-aar/com.google.android.gms/play-services/6.1.11/res/values/wallet_colors.xml
Error:(2) Attribute "color" has already been defined
/Users/matejl/Documents/AndroidStudio Projects/Paketek-beacon/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/res/values-v21/values-v21.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.TextView.SpinnerItem'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:(120, 21) No resource found that matches the given name: attr 'android:colorAccent'.
Error:(124, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'.
Error:(122, 21) No resource found that matches the given name: attr 'android:colorControlActivated'.
Error:(123, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'.
Error:(121, 21) No resource found that matches the given name: attr 'android:colorControlNormal'.
Error:(118, 21) No resource found that matches the given name: attr 'android:colorPrimary'.
Error:(119, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Error:(127, 21) No resource found that matches the given name: attr 'android:windowElevation'.
Error:(120, 21) No resource found that matches the given name: attr 'android:colorAccent'.
Error:(124, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'.
Error:(122, 21) No resource found that matches the given name: attr 'android:colorControlActivated'.
Error:(123, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'.
Error:(121, 21) No resource found that matches the given name: attr 'android:colorControlNormal'.
Error:(118, 21) No resource found that matches the given name: attr 'android:colorPrimary'.
Error:(119, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Error:(127, 21) No resource found that matches the given name: attr 'android:windowElevation'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Small'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ButtonBar'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.CheckBox'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.RadioButton'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
Error:(213, 21) No resource found that matches the given name: attr 'android:overlapAnchor'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
Error:(213, 21) No resource found that matches the given name: attr 'android:overlapAnchor'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.TextView.SpinnerItem'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
Error:(120, 21) No resource found that matches the given name: attr 'android:colorAccent'.
Error:(124, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'.
Error:(122, 21) No resource found that matches the given name: attr 'android:colorControlActivated'.
Error:(123, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'.
Error:(121, 21) No resource found that matches the given name: attr 'android:colorControlNormal'.
Error:(118, 21) No resource found that matches the given name: attr 'android:colorPrimary'.
Error:(119, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Error:(120, 21) No resource found that matches the given name: attr 'android:colorAccent'.
Error:(124, 21) No resource found that matches the given name: attr 'android:colorButtonNormal'.
Error:(122, 21) No resource found that matches the given name: attr 'android:colorControlActivated'.
Error:(123, 21) No resource found that matches the given name: attr 'android:colorControlHighlight'.
Error:(121, 21) No resource found that matches the given name: attr 'android:colorControlNormal'.
Error:(118, 21) No resource found that matches the given name: attr 'android:colorPrimary'.
Error:(119, 21) No resource found that matches the given name: attr 'android:colorPrimaryDark'.
Error:Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/matejl/Library/Android/sdk/build-tools/19.1.0/aapt'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 5.222 secs
Information:103 errors
Information:0 warnings
Information:See complete output in console

和我的build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
    }
}

apply plugin: 'android'
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:appcompat-v7:19.+'
 //   compile 'com.android.support:support-v4:21.0.0'
    compile 'com.google.android.gms:play-services:6.1.11'
    compile 'com.android.support:cardview-v7:22.1.1'
    compile 'com.android.support:design:22.2.0'
    compile project(':estimote-sdk')
}
android {
    signingConfigs {
        releaseconfig {
            keyAlias 'mobile'
            keyPassword '85922881'
            storeFile file('/Users/matejl/Documents/AndroidStudio Projects/MobileWorker-SZ/release-mobileworker.jks')
            storePassword '85922881'
            //master passsowr 85922881
        }
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    compileSdkVersion 19
    buildToolsVersion '19.1.0'
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    dexOptions {
        preDexLibraries = false
    }
    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 19

    }
productFlavors {
}
}

谢谢:D

2 个答案:

答案 0 :(得分:3)

如果您使用的是支持和设计v22,则必须针对SDK 22进行编译,因此您必须修改compileSdkVersionbuildToolsVersion

compileSdkVersion 22
buildToolsVersion '22.0.1'

请记住使用SDK Manager下载API SDK 22.

答案 1 :(得分:0)

@Arturo

我对“标题”而不是“颜色”有同样的问题。 你说

  

“您是否在自定义attrs xml文件中定义了任何属性颜色?”

是的,我在我的attrs.xml中定义了“title”。

我通过“edittext_title”更改了它,所以我工作了!

谢谢!