Error “Task :app:processDebugResources FAILED” on dev build of react-native run-android

I’m trying to run my app with ‘react-native run-android’ but it alerts this error when trying to build. Something with this resource android:attr/lStar not found.

> Task :app:processDebugResources FAILED
227 actionable tasks: 227 executed
Note: /home/leo/.dev/id_motorista/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/leo/.dev/id_motorista/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /home/leo/.dev/id_motorista/node_modules/react-native-background-fetch/android/src/main/java/com/transistorsoft/rnbackgroundfetch/HeadlessTask.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /home/leo/.gradle/caches/transforms-2/files-2.1/3e18a838e60dae2918cb4d785933a26e/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

Things I’ve already tried:

  • Clean gradle
  • Clean react cache
  • Clean metro cache
  • Clean yarn cache
  • Delete and reinstall node_modules
  • Change compileSdkVersion and targetSdkVersion to 31 on build.gradle