react-native-text-recognition
react-native-text-recognition copied to clipboard
android AAPT: error: resource android:attr/lStar not found react native 70.5.0
Execution failed for task ':react-native-text-recognition:verifyReleaseResources'.
AAPT: error: resource android:attr/lStar not found
react native version 70.5.0 expo version 47.0.3
gradle.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Project build.gradle project version
buildscript {
ext {
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '26')
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')
if (findProperty('android.kotlinVersion')) {
kotlinVersion = findProperty('android.kotlinVersion')
}
frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'
if (System.properties['os.arch'] == 'aarch64') {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = '24.0.8215888'
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = '21.4.7075529'
}
kotlin_version = '1.5.20'
kotlinVersion = '1.5.20'
reactNativeVersion = "0.70.5" // https://github.com/expo/expo/issues/18129
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('de.undercouch:gradle-download-task:4.1.2')
}
}
try adding this snippet to the end of android/build.gradle
configurations.all {
resolutionStrategy {
force 'androidx.core:core-ktx:1.6.0'
}
}
I still have the issue. I have no idea what's wrong.
I manually updated the compileSdkVersion, buildToolsVersion and targetSdkVersion to 31 on node_modules/react-native-text-recognition/android/build.gradle. That worked for me
android {
compileSdkVersion safeExtGet('TextRecognition_compileSdkVersion', 31)
buildToolsVersion safeExtGet('TextRecognition_buildToolsVersion', '31.0.0')
defaultConfig {
minSdkVersion safeExtGet('TextRecognition_minSdkVersion', 16)
targetSdkVersion safeExtGet('TextRecognition_targetSdkVersion', 31)
versionCode 1
versionName "1.0"
...
}
That seems to solve the issue! Thank you a lot :)