Open Pawan497 opened 10 months ago
Where: Build file 'F:\AssigmentForCompany\Android\UserManager\node_modules\react-native-safe-area-context\android\build.gradle' line: 35
What went wrong: A problem occurred evaluating project ':react-native-safe-area-context'.
org/jetbrains/kotlin/cli/common/CompilerSystemProperties
+1
Same thing happens on iOS build is failing.
+1
@aikhan any solution ??
Any updates?
Any updates, facing similar error, when newArch is enabled
Nope no update yet
I also got the same error on Chip M2 Pro
Same thing happens on iOS build is failing.
Have you fixed it yet?
Same failure on Android
FAILED: safeareacontext_autolinked_build/CMakeFiles/react_codegen_safeareacontext.dir/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp.o
/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp:15:8: error: use of undeclared identifier 'Style'
inline Style::Length valueFromEdges(
^
/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp:16:5: error: use of undeclared identifier 'Style'
Style::Length edge,
^
/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp:17:5: error: use of undeclared identifier 'Style'
Style::Length axis,
^
/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp:18:5: error: use of undeclared identifier 'Style'
Style::Length defaultValue) {
^
/home/project/node_modules/react-native-safe-area-context/common/cpp/react/renderer/components/safeareacontext/RNCSafeAreaViewShadowNode.cpp:19:22: error: use of undeclared identifier 'Unit'; did you mean 'folly::Unit'?
if (edge.unit() != Unit::Undefined) {
^~~~
folly::Unit
/home/project/node_modules/react-native/ReactAndroid/build/prefab-headers/folly_runtime/folly/Unit.h:36:8: note: 'folly::Unit' declared here
struct Unit {
+1 for android.
Updates?
After updating React native v0.73.6, its working fine in both Android and iOS
Issue Summary: I'm encountering build failures when trying to integrate the react-native-safe-area-context library into my Android project. The build fails with the following error messages:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where: Build file 'F:\AssigmentForCompany\Android\UserManager\node_modules\react-native-safe-area-context\android\build.gradle' line: 35
What went wrong: A problem occurred evaluating project ':react-native-safe-area-context'.
Try:
2: Task failed with an exception.
What went wrong: A problem occurred configuring project ':react-native-safe-area-context'.
Try:
Get more help at https://help.gradle.org
BUILD FAILED in 36s
Here is build.gradle
`buildscript { def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['RNSAC_kotlinVersion']
}
if (project == rootProject) { apply from: "spotless.gradle" return }
def getExtOrDefault(name, defaultValue) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultValue }
def isNewArchitectureEnabled() { // To opt-in for the New Architecture, you can either: // - Set
newArchEnabled
to true inside thegradle.properties
file // - Invoke gradle with-newArchEnabled=true
// - Set an environment variableORG_GRADLE_PROJECT_newArchEnabled=true
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" }apply plugin: 'com.android.library' apply plugin: 'kotlin-android'
if (isNewArchitectureEnabled()) { apply plugin: "com.facebook.react" }
android { def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION if (agpVersion.tokenize('.')[0].toInteger() >= 7) { namespace "com.th3rdwave.safeareacontext" }
}
def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : [ "armeabi-v7a", "x86", "x86_64", "arm64-v8a" ] }
repositories { google() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } mavenCentral() }
def kotlin_version = getExtOrDefault('kotlinVersion', project.properties['RNSAC_kotlinVersion'])
dependencies { implementation 'com.facebook.react:react-native:+' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" } `
This is my package.json
{ "name": "UserManager", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", "react": "18.2.0", "react-native": "0.72.4", "react-native-safe-area-context": "^4.7.1", "react-native-screens": "^3.24.0" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/eslint-config": "^0.72.2", "@react-native/metro-config": "^0.72.11", "@tsconfig/react-native": "^3.0.0", "@types/react": "^18.0.24", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.2.1", "eslint": "^8.19.0", "jest": "^29.2.1", "metro-react-native-babel-preset": "0.76.8", "prettier": "^2.4.1", "react-test-renderer": "18.2.0", "typescript": "4.8.4" }, "engines": { "node": ">=16" } }