简体   繁体   中英

AAPT: error: resource android:attr/lStar not found. React-native project

when I try to build the APK in my react-native project I'm facing AAPT: error: resource android:attr/lStar not found.

node version: 12.22.12 react-native: 0.63.2 buildToolsVersion: 29.0.2 minSdkVersion: 21 compileSdkVersion: 29 targetSdkVersion: 30 kotlinVersion: 1.3.72

This solution worked for me. Add the below mentioned code in the build.gradle file under android/app

    dependencies {
        // implementation "com.facebook.react:react-native:+"  // From node_modules
        implementation ("com.facebook.react:react-native:0.64.2") {
            force = true;
        }
   
    }
    

    apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
    

configurations.all {
        resolutionStrategy {
            force 'androidx.core:core:1.6.0'
            force 'androidx.core:core-ktx:1.6.0'
        }
    }

Updating from react-native@0.64.0 to react-native@0.64.4 worked for me with this same issue.

As described here:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM