Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such module 'React_RCTSwiftExtensions' #96

Closed
billyjacoby opened this issue Feb 6, 2024 · 15 comments
Closed

No such module 'React_RCTSwiftExtensions' #96

billyjacoby opened this issue Feb 6, 2024 · 15 comments
Labels
question Further information is requested

Comments

@billyjacoby
Copy link

Description

When trying to run the visionos/app.xcworkspace in xcode I receive the build error: No such module 'React_RCTSwiftExtensions'

Steps to reproduce

  1. Init the app by following the readme
  2. Open the visionos xcworkspace file
  3. See the error in the App.swift file

React Native Version

0.73.3

Affected Platforms

Build - MacOS

Output of npx react-native info

info Fetching system and libraries information...
warn Multiple Podfiles were found: ios/Podfile,visionos/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/main/docs/configuration.md
System:
  OS: macOS 14.4
  CPU: (10) arm64 Apple M1 Max
  Memory: 316.30 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/.nvm/versions/node/v18.18.2/bin/node
  Yarn:
    version: 4.1.0
    path: ~/.nvm/versions/node/v18.18.2/bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.2/bin/npm
  Watchman:
    version: 2024.01.22.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.0
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.9971841
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false


### Stacktrace or Logs

```text
`Module map file '/Users/billyjacoby/Library/Developer/Xcode/DerivedData/rnVision-bfdwviiuqrsrexfaodposxiccucp/Build/Products/Debug-xrsimulator/React-RCTSwiftExtensions/React_RCTSwiftExtensions.modulemap' not found
`

Reproducer

https://github.com/billyjacoby/vision-template

Screenshots and Videos

No response

@okwasniewski
Copy link
Member

Hey @billyjacoby,

Just cloned your repro and everything works as it should.

Can you try to clean the native build folder and pods:

cd visionos
rm -rf Pods build

then reinstall pods:

bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install

Open the project in Xcode and try to build it. Also make sure you've installed dependencies with yarn

@okwasniewski okwasniewski added the question Further information is requested label Feb 6, 2024
@billyjacoby
Copy link
Author

Hmm still seeing the same thing, not sure if this screenshot of the errors in XCode is helpful:
Screenshot 2024-02-06 at 8 13 54 AM

@okwasniewski
Copy link
Member

Can you try CMD+K in Xcode (this cleans build folder) if that won't help try to Clear Xcode Derived data

@billyjacoby
Copy link
Author

Still nothing, getting the same errors.

@billyjacoby
Copy link
Author

One interesting thing I noticed is that when I ran yarn visionos (successfully) i saw this line:

Multiple Podfiles were found: ios/Podfile,visionos/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/main/docs/configuration.md

Which looks like it's using the iOS Podfile instead of the visionos Podfile, could this be related?

@okwasniewski
Copy link
Member

Can you share a screenshot of how your built app looks? I need to fix this warning in CLI as it's not really accurate and you should still use visionos Podfile. Also you can try if you can build your app through Xcode now

@billyjacoby
Copy link
Author

So this issue that I'm having is building the app through XCode, that's the only time I face this issue.

Here's the built app (without the dev server running)

image

@okwasniewski
Copy link
Member

Ah so it's using visionos Podfile, that's great.

Im not sure why you are facing those issues (probably they are only appearing in Xcode.app as building through CLI also uses Xcode build tools and it works). Xcode sometimes is weird so restarting your Mac or something may help here.

@billyjacoby
Copy link
Author

Sorry had to start work, but restarting my laptop didn't fix this issue.

@okwasniewski okwasniewski reopened this Feb 6, 2024
@okwasniewski
Copy link
Member

Ah, okay I thought it's fixed. So even if you built the app through yarn visionos and then open Xcode and try to build it still shows the same error? Can you also try initializing a new project?

@billyjacoby
Copy link
Author

Yeah, yarn visionos then opening XCode shows the same error. Lemme try a new project in a few mins and get back to you. For some reason I get other issues running bundle install when I try this from my work machine

@billyjacoby
Copy link
Author

Okay a brand new install seems to work fine, which is super strange because I only initialized the other project this morning right before I opened this 🤔

@Saadnajmi
Copy link

A guess: I think cocoapods 1.15 had issues with the cocoapods caches, and doesn't work with React Native at the moment?

@billyjacoby
Copy link
Author

Interestingly I'm using 1.15.0 on the machine I eventually got this working on but I can't get this to build on the machine using 1.14.3

@billyjacoby
Copy link
Author

Just to further comment here - updating to Cocopods version 1.15.2 seems to have fixed this so it seems that was the culprit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants