android - Android App Project停止编译,grade.build错误

标签 android gradle

我是gradle的新手,从Android的第一步开始。

直到昨天,我才能够编译和测试我的Android App,当我单击“调试'app'”时突然停止编译并出现此错误

Android resource linking failed
C:\Users\Nicolas\AndroidStudioProjects\ATMobile\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2508: error: resource android:attr/fontVariationSettings not found.
C:\Users\Nicolas\AndroidStudioProjects\ATMobile\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:2509: error: resource android:attr/ttcIndex not found.
error: failed linking references.

这是我的成绩。buil(应用程序)
apply plugin: 'com.android.application'

android {
    signingConfigs {
    }
    compileSdkVersion 26
//    buildToolsVersion "26.0.2"

    defaultConfig {
        applicationId "ar.com.codigose.atmobile"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0 BETA"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    //buildToolsVersion '29.0.0 rc1'
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1'
    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'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.nbsp:library:1.8'
    implementation 'android.arch.navigation:navigation-fragment:1.0.0'
}

我评论了buildToolsVersion标记,因为我在github中看到了原始文件,并且没有该行。

和这个成绩。buil(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url  "http://dl.bintray.com/lukaville/maven"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我想继续在SDK 26中进行开发,但是看不到有什么问题。

在ide中,该行:
实现'com.android.support:appcompat-v7:26.1.0'

强调并说找到了28.0.0版本的内容,但该版本我什么也没有。

到底是怎么回事 ??
最好的祝福

最佳答案

如果您要在与原始文件不同的Android SDK版本上构建此应用,则此Udacity链接可能会有所帮助(页面的注释部分):

https://classroom.udacity.com/courses/ud839/lessons/7633778648/concepts/2eef07a4-abb3-448f-8025-8aeb7cf21621

关于android - Android App Project停止编译,grade.build错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56229738/

相关文章:

android - kotlin 中数据绑定(bind)的好处?

gradle - Gradle:根据文件列表从目录中删除文件

gradle - 使用 Gradle 将 rpm 工件发布到 yum 快照存储库时遇到问题

android - Android 上类似 teamviewer 的应用程序技术

android - Kotlin 主要和次要构造函数问题

android - Android Beacon Library真的支持后台扫描吗?

android - 创建一个使用 google play 服务的 Android 库

java.util.zip.ZipException : duplicate entry: META_INF/LICENSE. txt

unit-testing - 在buildSrc目录中运行测试用例的问题

android - 将 startMethodTracing 和 stopMethodTracing 与 ddms 结合使用