首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Gradle中编译新材料库

无法在Gradle中编译新材料库
EN

Stack Overflow用户
提问于 2018-05-15 15:17:17
回答 1查看 486关注 0票数 1

我无法添加新的Material Design库。当我添加compile 'com.google.android.material:material:1.0.0-alpha1'并同步项目时,我收到以下两个错误:

代码语言:javascript
复制
error: resource android:attr/fontVariationSettings not found.
error: resource android:attr/ttcindex not found.

我的build.gradle

代码语言:javascript
复制
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "rockthesport.com.pruebasmaterial"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    compile 'com.google.android.material:material:1.0.0-alpha1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

有什么建议吗?

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2018-05-15 16:06:33

要使用新的Material Components library 'com.google.android.material:material:1.0.0-alpha1',您必须使用

代码语言:javascript
复制
android {
        compileSdkVersion 'android-P'

        defaultConfig {
            targetSdkVersion 'P'
        }
        ...
    }
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50344388

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档