react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Build failed: 'react/renderer/components/view/ViewProps.h' file not found

Open GaylordP opened this issue 9 months ago • 17 comments

Hello and thank you for your library! :)

Since yesterday morning, I haven't been able to build my project at all using the command npx react-native run-android. I keep getting this error:

node_modules/react-native-safe-area-context/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/safeareacontext/Props.h:12:10: fatal error: 'react/renderer/components/view/ViewProps.h' file not found
#include <react/renderer/components/view/ViewProps.h>

I found a topic about this, but the issue seemed to be resolved (link).

I have tried many times (more than fifteen times) to clear the Yarn, node_modules, and Gradle caches without success.

This issue appeared very suddenly yesterday morning—at 8 AM, everything was working, and by 12 PM, it had stopped working. I didn't modify any dependencies in my project; I simply cleared the caches and node_modules around noon to build a production version.

rm -rf android/.gradle android/.idea android/app/build android/build
rm -rf package-lock.json yarn.lock node_modules
npx react-native start --reset-cache
./android/gradlew clean

Here is my configuration:

  • react-native : 0.76.5
  • react-native-safe-area-context : 5.0.0
  • ndkVersion : 26.1.10909125
  • kotlinVersion : 1.9.24
  • gradle : 8.10.2

react-native info :

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 99.31 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.4.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 3.6.4
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.07.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK:
    API Levels:
      - "34"
      - "35"
    Build Tools:
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12700392
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.12
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
  react:
    installed: 18.3.1
    wanted: ^18.3.1
  react-native:
    installed: 0.76.5
    wanted: 0.76.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Thank you in advance if you can help me, as I don't have many ideas left to debug this problem.

GaylordP avatar Jan 09 '25 10:01 GaylordP