实施material.io时出错-为什么这样做?

时间:2019-05-18 07:54:16

标签: android android-gradle android-support-library

每当我添加实现'com.google.android.material:material:1.0.0'并尝试构建我的项目时,它都会失败:

AGPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not
 found.","sources":[{"file":".gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/d7c317b06402f0d32ee3cf13363bbddb/res/values/values.xml","position":{"startLine":250,"startColumn":4,"startOffset":27058,"endColumn":68,"endOffset":27122}}],"original":"","tool":"AAPT"}
:app:processLocal1DebugResources :app:processLocal1DebugResources
FAILED FAILURE: Build failed with an exception.
  * What went wrong: Execution failed for task ':app:processLocal1DebugResources'.
Failed to process resources, see aapt output above for details.

这是我的gradle脚本:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
def keystorePropertiesFile = rootProject.file("keystore.properties")
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {  
    compileSdkVersion 27
    defaultConfig {
        applicationId "***********"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 26
        versionName "3.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation":"$projectDir/schemas".toString()]
                includeCompileClasspath false
            }
        }
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    lintOptions {
        checkReleaseBuilds false
    }
    signingConfigs {
        config {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile file(keystoreProperties['storeFile'])
            storePassword keystoreProperties['storePassword']
        }
    }
    dataBinding {
        enabled = true
    }
    dexOptions {
        jumboMode = true
    }
    flavorDimensions "version"
    productFlavors {

        prod {
            dimension "version"
            signingConfig signingConfigs.config
            applicationId '*******'

        }
        preprod {
            dimension "version"
            signingConfig signingConfigs.config
            applicationId '*******'

        }

    }
}

dependencies {
    def room_version = "1.1.1"
    def version = "2.0.0"

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
   implementation 'com.google.android.material:material:1.0.0'
   implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.code.gson:gson:2.4'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.google.android.gms:play-services-vision:15.0.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.github.pchmn:MaterialChipsInput:1.0.1'
    implementation project(':MPChartLib')
    implementation project(':volley')
    implementation files('libs/org.apache.http.legacy.jar')
    implementation 'devs.mulham.horizontalcalendar:horizontalcalendar:1.2.2'
    implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
    implementation 'com.libaml.android.view.chip:AndroidChipLayout:1.0.6'
    implementation 'com.github.ganfra:material-spinner:2.0.0'
    implementation 'com.google.android:flexbox:0.3.0-alpha3'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation project(':monthyearpicker')
    implementation 'me.drakeet.support:toastcompat:1.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-perf:15.2.0'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-iid:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.3.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation 'com.android.support:multidex:1.0.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }
    implementation project(':chipCloud')

    implementation 'com.squareup.picasso:picasso:2.5.0'
    implementation "android.arch.persistence.room:runtime:$room_version"
    annotationProcessor "android.arch.persistence.room:compiler:$room_version"
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
    implementation "com.github.prolificinteractive:material-calendarview:$version"
}
apply plugin: 'com.google.gms.google-services'

0 个答案:

没有答案