0

我遇到了来自 aapt2 的以下错误:

我的环境如下:

  • 安卓工作室 3.4.1
  • Gradle 插件:3.4.1
  • 苹果系统
  • build.gradle如下:
android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "com.arophix.example"
        minSdkVersion 19
        targetSdkVersion 28

        versionCode 0
        versionName "1.0"
    }

    buildTypes {
        debug {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt')
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt')
        }
    }

    ...
}

dependencies {
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    ...
}

错误如下:

> 1 exception was raised by workers:
  com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  error: resource style/Theme.AppCompat.Light (aka com.arophix.example:style/Theme.AppCompat.Light) not found.
  error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.arophix.example:style/Theme.AppCompat.Light.NoActionBar) not found.
  ~/example/example/app/build/intermediates/res/merged/release/values/values.xml:95: error: resource style/Theme.AppCompat.Light.Dialog.Alert (aka com.arophix.example:style/Theme.AppCompat.Light.Dialog.Alert) not found.
  error: resource style/Widget.AppCompat.Button.Colored (aka com.arophix.example:style/Widget.AppCompat.Button.Colored) not found.
  error: resource style/Widget.AppCompat.Button.Colored (aka com.arophix.example/Widget.AppCompat.Button.Colored) not found.
  error: failed linking references.

关于如何解决这个问题的任何想法?

4

1 回答 1

2

删除buildToolsVersion并尝试

于 2019-07-04T08:14:52.643 回答