AAPT: error: resource android: attr/IStar not found.
This error occurred suddenly, it was working fine last week.
I've tried many solutions but none works. Solutions tried:
- Delete, reinstall npm, using
npm install
- clean gradle with
./gradlew clean
in /android - Cleaning npm cache with
npm cache clean --force
- add
org.gradle.jvmargs=-Xmx4608m
in /android/gradle.properties - In /android/build.gradle, inside
ext{}
addandroidXCore = "1.6.0"
npm update @react-native-community/netinfo
- 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
CodePudding user response:
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
CodePudding user response:
There had been a series of build failures React Native & Expo users have been experiencing when building Android apps starting from November 4th 2022. Your issue is the same.
Since you are using React-native 0.63
React-native has a new patch released for it. try updating your react-native in your package.json
from "react-native": "^0.63.4"
to "react-native": "^0.63.5"
and try running npm install
and everything will work fine.
The suggested answer by Thanhal will give you some headaches if you try to upgrade to a new version of react-native and forget to remove it from build.gradle.
for more info please refer to This issue on github