I am running into below error from aapt2:
My enviroment is as below:
- Android Studio 3.4.1
- Gradle plugin: 3.4.1
- macOS
build.gradleis as below:
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'])
...
}
Error is as below:
> 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.
Any ideas about how to solve this issue?
Themeyou have used that is not found.resource linking failedmeans resource linking is not properly done. Just change the theme that is mention in the error. Read theerrorproperly and solve this easily. This is not a complicated error. Try once you will be succeeded. If get any problem let me know../gradlew assembleDebugit has no such error, but./gradlew assembleReleasewill bring up this error.themesthat are mention in theerrorlog. Have you tried it by terminalgradle buildif not then please try once again.