1. 报错日志
AAPT2 error check logs for details
2. 解决方案
谷歌在 3.2.0+ 版本中已经修复了这个bug,在项目中的build.gradle 配置到3.3.0+,例如 classpath ‘com.android.tools.build:gradle:3.2.0’
例如我的 AS 是ProjectStructure->Project->查看Android Plugin Verison : 3.2.0
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}