Android is a smartphones operating system not a single person on the earth is unaware of. Android touch screen phones and tablets are quite famous all over the world. You may not know that its operating system is based on Linux. Android is owned by Google. As it is really popular, a lot of programs and applications are designed for users having Android gadgets. When working on the Android program, you can get the warning “A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade in Android”.
You don’t need to panic when you encounter this error as we are crafting this post to help you solve the error, and also guide you in a simple way so that you understand the error and the solutions. Let’s have a look at how you get the error
How you land up in the error
At the time of executing the program code, you end up with this error
Execution failed for task:
am:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/.gradle/caches/transforms-2/files-2.1/ff28653768e2ccb1135467db3600af3a/core-1.7.0-alpha02/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
This is what error message you get. Check out the solution to handle the exception
Solutions to tackle “A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade in Android”
Here are a few effective solutions to solve the error
Solution 1 – Switch to android.core:core-ktx:1.0.6
This way you may get rid of the error warning. You need to replace a line in your file app/build.gradle
Use this
androidx.core:core-ktx:1.6.0
instead of
androidx.core:core-ktx:+
Once you replace it, your program code may look like this
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
googlePlayServicesAuthVersion = "16.0.1"
androidXCore = "1.6.0"
}
Solution 2 – Upgrade the compile SDK to Android 31
You get the error warning when you haven’t upgraded the versions. In this case, you use androidx.core:core-ktx:+, then you will be needing the latest androidx.core:core-ktx:+ version. The latest version is 1.7.0. you also need to upgrade the Android 31 compile SDK version. If you don’t have everything in that way, you end up with the error.
You simply have two ways to deal with the error
Either upgrade the compile SDK to Android 31 or use androidx.core:core-ktx:${version} rather than using the androidx.core:core-ktx:+.
This is one of the ways to fix the error.
Solution 3 – Update gradle version
You just need to update the gradle version to get rid of the error warning.
Use
classpath "com.android.tools.build:gradle:4.1.3"
instead of
classpath "com.android.tools.build:gradle:4.1.2"
Solution 4 – Use command in Android Studio
You need to use the following command to fix the issue
File > Invalidate Caches/Restart...
Solution 5 – Set a new key password
To do this, follow the below steps
- You need to close the project, and then reopen it
- Before building, you have to enter the Keystore password
This way, you can simply solve the error.
Conclusion
Different solutions are discussed to help you fix the error “A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade in Android”. You can choose the solution that fits best to your condition. I wish you luck!
Reference Source: https://forum.unity.com/threads/a-failure-occurred-while-executing-com-android-build-gradle-internal-tasks-workers-actionfacade.958112/