zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.73k stars 257 forks source link

Cannot find protocol definition for 'NativeRNBootSplashSpec' #647

Closed yashdiq closed 2 weeks ago

yashdiq commented 2 weeks ago

Before submitting a new issue

Bug summary

I found this error when running on RN 0.76.1 as attached in the screenshot.

Screenshot 2024-11-03 at 20 19 41

Library version

6.2.6

Environment info

System:
  OS: macOS 15.0.1
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 36.05 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v20.9.0/bin/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.1
      - iOS 18.1
      - macOS 15.1
      - tvOS 18.1
      - visionOS 2.1
      - watchOS 11.1
  Android SDK:
    API Levels:
      - "23"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Google Play Intel x86 Atom
      - android-33 | Google APIs Intel x86_64 Atom
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12071903
  Xcode:
    version: 16.1/16B40
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.7
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.1
    wanted: 0.76.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Steps to reproduce

  1. clear all cache and deintegrate pods
  2. run bundle install && bundle exec pod install

Reproducible sample code

run from the example codes
zoontek commented 2 weeks ago

Be sure that RN codegen properly ran.

Run https://www.npmjs.com/package/react-native-clean-project if required.

nagykrisztianendre commented 2 weeks ago

Hello @yashdiq

Did you manage to solve the problem?

I'm facing the same issue but can't see anything wrong during RN codegen. When I comment out Bootsplash, everything builds correctly.

yashdiq commented 2 weeks ago

not yet @nagykrisztianendre, it's been days and what @zoontek suggested is not working.

nagykrisztianendre commented 2 weeks ago

Hello @yashdiq

I was able to solve the problem on my end. The root cause was indeed related to the codegen, specifically because the files were not correctly compiled. To solve the issue, I changed the setting in Xcode under Build Settings -> Apple Clang - Language -> Compile Sources As to 'Objective-C++' instead of 'According to File Type,' and everything built successfully after that.

I hope this solution works for you as well.

yashdiq commented 2 weeks ago

Hi @nagykrisztianendre I wanna try your workaround above but I can't see this option: Build Settings -> Apple Clang - Language -> Compile Sources As to 'Objective-C++'. Can you give me the screenshot of your XCode?

nagykrisztianendre commented 2 weeks ago

Yes. @yashdiq Here it is:

image

yashdiq commented 2 weeks ago

Thanks bro @nagykrisztianendre found it.

yashdiq commented 2 weeks ago
Screenshot 2024-11-06 at 17 40 57

Still the same 😂

nagykrisztianendre commented 2 weeks ago

Have you tried running pod install before rebuilding the project?