react-native-safe-area-context
react-native-safe-area-context copied to clipboard
Build failed on RN version 0.69.1
node_modules/react-native-codegen/lib/parsers/typescript/index.js:191
throw parsingErrors[0];
^
UnusedModuleTypeScriptInterfaceParserError: Module NativeSafeAreaContext.d: Unused NativeModule spec. Please load the NativeModule by calling TurboModuleRegistry.get<Spec>('<moduleName>').
+1
+1
I'm having the same problem. Anyone found a solution for this?
Did you create a new project with version 0.69.1 or update an existing project with an older react-native version?
It's an updated version. Looks good with a diff.
Did you create a new project with version 0.69.1 or update an existing project with an older react-native version?
I'm using a fresh npx react-native init project.
Steps to reproduce:
- create new project using npx react-native init
- change to the new architecture, make sure its building correctly
- add react-native-safe-area-context and try to rebuild with npx react-native android.
E:\projetos\reactnice\node_modules\react-native-codegen\lib\parsers\typescript\index.js:191
throw parsingErrors[0];
^
UnusedModuleTypeScriptInterfaceParserError: Module NativeSafeAreaContext.d: Unused NativeModule spec. Please load the NativeModule by calling TurboModuleRegistry.get<Spec>('<moduleName>').
I suspect this is related to the react-native-code-gen Gonna try to build it w/o the lib in the project after lunch and report back.
If you start a new project with 0.69 you don't need to do thats changes in your project. To enable new architecture on android you can, set the newArchEnabled property to true by either:
- Changing the corresponding line inside the android/gradle.properties file.
- Set an environment variable ORG_GRADLE_PROJECT_newArchEnabled=true
- Invoke Gradle with -PnewArchEnabled=true
And nothing more.
If you, like us :), make changes from Prerequisites for Applications from official documentation for new 0.69 project, or you upgrade to 0.69 from previous versions (with new acrhitecture enabled) you need to remove from
apply plugin: "com.facebook.react"
react { reactRoot = rootProject.file("../node_modules/react-native/") codegenDir = rootProject.file("../node_modules/react-native-codegen/") }
And this:
implementation project(":ReactAndroid")
replace with:
implementation "com.facebook.react:react-native:+"
Ok, thanks for the information!
So I tried to build it again using the suggested changes. After I cloned the project again from https://github.com/Skullcan/reactnice. Ran a build w/o problems in the emulator. Added react-native-safe-area-context again and tried to run again.
The error thrown was:
Execution failed for task ':react-native-safe-area-context:configureNdkBuildDebug[arm64-v8a]'. [CXX1405] error when building with ndkBuild using E:\projetos\reactnice\node_modules\react-native-safe-area-context\android\src\main\jni\Android.mk: Build command failed. Android NDK: ERROR:E:\projetos\reactnice\node_modules\react-native-safe-area-context\android\src\main\jni\Android.mk:fb: LOCAL_SRC_FILES points to a missing file Android NDK: Check that E:\projetos\reactnice\android\app\build/react-ndk/exported/arm64-v8a/libfb.so exists or that its path is correct
PS: The file mentioned in the error exists.

Some context:
- I'm running this build in a Windows 11 machine.
- I had to change the NDK version to 23.1.7779620 because of the maximum object file path in windows is 250 characters and the build was failing using the standard version 21.4.7075529.
- The project builds fine if I remove react-native-safe-area-context.
This is my npx react-native info fwiw:
E:\projetos\reactnice>npx react-native info info Fetching system and libraries information... System: OS: Windows 10 10.0.22622 CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz Memory: 12.83 GB / 31.87 GB Binaries: Node: 16.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.15 - C:\Program Files\nodejs\yarn.CMD npm: 8.5.2 - ~\AppData\Roaming\npm\npm.CMD Watchman: 20200914.225852.0 - C:\Users\skull\AppData\Local\watchman\watchman.EXE SDKs: Android SDK: API Levels: 23, 25, 27, 28, 29, 30, 31, 33 Build Tools: 28.0.3, 29.0.1, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0, 33.0.0 System Images: android-24 | Google Play Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Google Play Intel x86 Atom_64, android-33 | Google Play Intel x86 Atom_64 Android NDK: 22.1.7171670 Windows SDK: AllowDevelopmentWithoutDevLicense: Enabled AllowAllTrustedApps: Enabled Versions: 10.0.19041.0 IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: 11.0.15 - E:\jdk\azul-11.0.15\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: 0.69.1 => 0.69.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Thanks in advance for the help!
I think you should try to install react-native-codegen (0.69.1 version)
And after, run ./gradlew clean (inside android project folder)
I think you should try to install react-native-codegen (0.69.1 version) And after, run
./gradlew clean(inside android project folder)
Hi, I tried using the react-native-codegen 0.69.1 version, same error. Tried some fixes I saw in the react-native-gesture-handler lib in this PR too. Sadly no success building it.
I also tried to build it under a WSL2 instance I have running here. Got pretty much the same error in all attempts.
Android NDK: ERROR:/home/skull/projetos/reactnice/node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file Android NDK: Check that /home/skull/projetos/reactnice/android/app/build/react-ndk/exported/arm64-v8a/libfb.so exists or that its path is correct
I'm at a loss atm. Dunno what I'm doing wrong hahaha
does anyone solved it?? am getting the same
Any updates on this issue? Anyone fixed it?
does anyone solved it?? am getting the same
Any updates on this issue? Anyone fixed it?
Hey, the solution from https://github.com/th3rdwave/react-native-safe-area-context/issues/294#issuecomment-1185682181 works for me! 🥳
In my case I needed to remove the following lines in android/app/build.gradle:
-apply plugin: "com.facebook.react"
-react {
- reactRoot = rootProject.file("../node_modules/react-native/")
- codegenDir = rootProject.file("../node_modules/react-native-codegen/")
- jsRootDir = rootProject.file("../")
- libraryName = "appname"
- codegenJavaPackageName = "com.appname"
-}
When it comes to the libfb.so error, one solution is to simply build the app again. Usually it works on the second attempt. If you CI fails, you can add a step to run the task cd android && ./gradlew :ReactAndroid:packageReactNdkDebugLibs that will compile libfb.so. Then the app should build as normal.
anyone found a solution for this still getting the same error
[CXX1405] error when building with ndkBuild using node_modules/react-native-safe-area-context/android/src/main/jni/Android.mk: Build command failed.
Compiled and released an app with RN 0.70.1.