Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade [duplicate]

AAPT: error: resource android: attr/IStar not found.

This error occurred suddenly, it was working fine last week.

enter image description here

I've tried many solutions but none works. Solutions tried:

  1. Delete, reinstall npm, using npm install
  2. clean gradle with ./gradlew clean in /android
  3. Cleaning npm cache with npm cache clean --force
  4. add org.gradle.jvmargs=-Xmx4608m in /android/gradle.properties
  5. In /android/build.gradle, inside ext{} add androidXCore = "1.6.0"
  6. npm update @react-native-community/netinfo
  7. androidx.core:core-ktx:+ to androidx.core:core-ktx:1.6.0 but I've searched through my project, there is no 'androidx.core:core-ktx:+. So this solution I found is irrelevant.

Version:

"react-native": "0.63.4",

compileSdkVersion = 29
targetSdkVersion = 29
like image 972
AhChing11 Avatar asked Nov 19 '25 15:11

AhChing11


1 Answers

Add this in your android/buld.gradle file.

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
    configurations.all {
        resolutionStrategy {
            // Remove this override in 0.65+, as a proper fix is included in react-native itself.
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }

Ref : https://github.com/facebook/react-native/issues/35210

like image 129
Thanhal Avatar answered Nov 21 '25 04:11

Thanhal