What is the Android resource linking failed error?

While developing an Android application in Android Studio, you may come across some errors. One such error is the Android resource linking failed error.

The error might look something like this:

    Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed (AAPT2 27.0.3 Daemon #0)

How to fix the error

Openplatforms/android/app/build.gradleandplatforms/android/build.gradle and replace the following code in the files:

'com.android.support:support-v4:+'

With:

'com.android.support:support-v4:27.1.0'

This should yield the following configuration settings:

configurations.all {
resolutionStrategy {
    force 'com.android.support:support-v4:27.1.0'
}}

The Android resource linking failed error can also occur if you have an error in any of your XML resources.

Copyright ©2024 Educative, Inc. All rights reserved