首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >怎样解决Android资源链接失败问题???

怎样解决Android资源链接失败问题???

提问于 2019-10-17 09:16:07
回答 0关注 0查看 1.7K

编译器显示错误:

代码语言:js
复制
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
D:\And protect\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:559: error: resource color/colorPrimary (aka com.example.myapplication:color/colorPrimary) not found.
D:\And protect\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:560: error: resource color/colorPrimaryDark (aka com.example.myapplication:color/colorPrimaryDark) not found.
D:\And protect\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:561: error: resource color/colorAccent (aka com.example.myapplication:color/colorAccent) not found.
error: failed linking references.

项目构建gradle:

代码语言:js
复制
buildscript {
    repositories {
        google()
        jcenter()
        
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        
    }
}

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

模块构建gradlea:

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

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

我的清单:

代码语言:js
复制
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


Android升级之前用的用的挺好的,升级之后就显示错误,求大神指导!!!

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

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