vision-camera-code-scanner
vision-camera-code-scanner copied to clipboard
values.xml:2761: AAPT: error: resource android:attr/lStar not found.
when building an application with the command ./gradlew assembleRelease an error has appeared.
ERROR: ...\node_modules\vision-camera-code-scanner\android\build\intermediates\merged_res\release\values\values.xml:2761: AAPT: error: resource android:attr/lStar not found.
I use the most up-to-date versions of all packages
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-gesture-handler": "^2.8.0",
"react-native-reanimated": "^2.12.0",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.18.2",
"react-native-vision-camera": "^2.15.2",
"vision-camera-code-scanner": "^0.2.0"

lStar in core-1.7.0, some resource have been deleted,but those ones can be used in core-1.6.0,for these show AAPT: error: resource android:attr/lStar not found gradle build task failed tip, maybe we can try add following code in build.gradle dependencies:
implementation("androidx.core:core:1.6.0") {
force = true
}
implementation("androidx.core:core-ktx:1.6.0") {
force = true
}
anyway, it works for me.
it didn't help me :(
I had the same issue for building with targetSdkVersion 33: this approach worked for me: In build.gradle (project) I added SDK values to builscript -> ext
buildscript { ... ext { ... VisionCameraCodeScanner_compileSdkVersion = 33 VisionCameraCodeScanner_minSdkVersion = 21 VisionCameraCodeScanner_targetSdkVersion = 33 } ... }
to override default compile and target SDK version. I hope it would help.
thank you, it helped!
@AliBaseghiVirtudev answer worked on my RN 0.70.6, I was getting this when i was using,
compileSdkVersion = 33
targetSdkVersion = 33
this ⬆ in my project lavel build.gradle file, I have changed them to Version "31" now everything is working fine.
Below is my entire project level build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
// compileSdkVersion = 31
// targetSdkVersion = 31
/*
compileSdkVersion = 33
targetSdkVersion = 33
*/
compileSdkVersion = 31
targetSdkVersion = 31
VisionCameraCodeScanner_compileSdkVersion = 33
VisionCameraCodeScanner_minSdkVersion = 21
VisionCameraCodeScanner_targetSdkVersion = 33
/*
androidXCore = "1.6.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"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.2")
// classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
I had the same issue for building with targetSdkVersion 33: this approach worked for me: In build.gradle (project) I added SDK values to builscript -> ext
buildscript { ... ext { ... VisionCameraCodeScanner_compileSdkVersion = 33 VisionCameraCodeScanner_minSdkVersion = 21 VisionCameraCodeScanner_targetSdkVersion = 33 } ... }
to override default compile and target SDK version. I hope it would help.
lifesaver!
I had the same issue for building with targetSdkVersion 33: this approach worked for me: In build.gradle (project) I added SDK values to builscript -> ext
buildscript { ... ext { ... VisionCameraCodeScanner_compileSdkVersion = 33 VisionCameraCodeScanner_minSdkVersion = 21 VisionCameraCodeScanner_targetSdkVersion = 33 } ... }
to override default compile and target SDK version. I hope it would help.
it worked for me, thanks!
@AliBaseghiVirtudev answer worked on my RN 0.70.6, I was getting this when i was using,
compileSdkVersion = 33 targetSdkVersion = 33this ⬆ in my project lavel build.gradle file, I have changed them to Version "31" now everything is working fine.
Below is my entire project level build.gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "31.0.0" minSdkVersion = 21 // compileSdkVersion = 31 // targetSdkVersion = 31 /* compileSdkVersion = 33 targetSdkVersion = 33 */ compileSdkVersion = 31 targetSdkVersion = 31 VisionCameraCodeScanner_compileSdkVersion = 33 VisionCameraCodeScanner_minSdkVersion = 21 VisionCameraCodeScanner_targetSdkVersion = 33 /* androidXCore = "1.6.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" } } repositories { google() mavenCentral() } dependencies { classpath("com.android.tools.build:gradle:7.2.2") // classpath("com.android.tools.build:gradle:7.2.1") classpath("com.facebook.react:react-native-gradle-plugin") classpath("de.undercouch:gradle-download-task:5.0.1") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } mavenCentral { // We don't want to fetch react-native from Maven Central as there are // older versions over there. content { excludeGroup "com.facebook.react" } } google() maven { url 'https://www.jitpack.io' } } }
it will work for flutter?
I just fixed this issue by replace ./gradlew assembleRelease by ./gradlew app:assembleRelease
I just fixed this issue by replace ./gradlew assembleRelease by ./gradlew app:assembleRelease
This worked.
I just fixed this issue by replace ./gradlew assembleRelease by ./gradlew app:assembleRelease
Why does this work?
I just fixed this issue by replace ./gradlew assembleRelease by ./gradlew app:assembleRelease Why does this work?