Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource linking fails on lStar

I'm working on a React Native application. My Android builds began to fail in the CI environment (and locally) without any changes.

Execution failed for task ':app:processDevelopmentDebugResources'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
.../app/build/intermediates/incremental/mergeDevelopmentDebugResources/merged.dir/values/values.xml:2682: AAPT: error: resource android:attr/lStar not found.

According to Android: Resource linking fails on test execution even when nothing has been changed, this happened because some library got upgraded.

lStar needs compileSdkVersion 31 and my project used compileSdkVersion 28.

How can I track which libraries got updated recently, or which library is causing this?

like image 350
Eduardo Carminati Avatar asked Sep 01 '21 22:09

Eduardo Carminati


People also ask

How do I get rid of Android Resource Link failed?

How do I remove "Failed linking resources" error in Andriod studio? You may be having this error on your JAVA files because there is one or more XML file with an error. Go through all your XML files and resolve errors, then clean or rebuild the project from the build menu. Start with your most recent edited XML file.


Video Answer


2 Answers

The problem is @react-native-community/netinfo. Just try to update the package using

yarn add @react-native-community/netinfo

or

npm update @react-native-community/netinfo

There isn't any need to change anything over your Gradle or Android files as those might mess things up even more.

like image 154
Barath Kumar Avatar answered Oct 12 '22 18:10

Barath Kumar


Go to android/build.gradle and add androidXCore = "1.6.0" to ext:

ext {
    buildToolsVersion = "29.0.2"
    minSdkVersion = 21
    compileSdkVersion = 29
    targetSdkVersion = 29
    googlePlayServicesAuthVersion = "16.0.1"
    androidXCore = "1.6.0"
}
like image 30
Roman Ustyantsev Avatar answered Oct 12 '22 17:10

Roman Ustyantsev