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

run-ios doesn't work with default test app from init-test-app #375

Closed
1 of 4 tasks
Saadnajmi opened this issue Jun 27, 2021 · 4 comments · Fixed by react-native-community/cli#1444
Closed
1 of 4 tasks
Labels
bug Something isn't working platform: iOS This affects iOS platform: macOS This affects macOS upstream This should be fixed/reported upstream

Comments

@Saadnajmi
Copy link
Collaborator

Description

I tried using yarn init-test-app to make a new RNTA-based test app for the community module react-native-menu. The test app will run fine from Xcode. Attempting yarn ios gives me the following error:

saads-macbook-pro:example sanajmi$ yarn ios
yarn run v1.22.10
$ react-native run-ios
error ENOENT: no such file or directory, open '/Users/sanajmi/workspace/menu/example/ios/ReactTestApp-Dummy.xcodeproj/project.pbxproj'.
Error: ENOENT: no such file or directory, open '/Users/sanajmi/workspace/menu/example/ios/ReactTestApp-Dummy.xcodeproj/project.pbxproj'
    at Object.openSync (node:fs:582:3)
    at Object.readFileSync (node:fs:450:35)
    at pbxProject.parseSync (/Users/sanajmi/workspace/menu/example/node_modules/xcode/lib/pbxProject.js:61:28)
    at isInstalled (/Users/sanajmi/workspace/menu/example/node_modules/@react-native-community/cli-platform-ios/build/link/isInstalled.js:43:67)
    at Object.isInstalled (/Users/sanajmi/workspace/menu/example/node_modules/@react-native-community/cli-platform-ios/build/link/common/isInstalled.js:23:35)
    at warnAboutManuallyLinkedLibs (/Users/sanajmi/workspace/menu/example/node_modules/@react-native-community/cli-platform-ios/build/link/warnAboutManuallyLinkedLibs.js:43:28)
    at Object.runIOS [as func] (/Users/sanajmi/workspace/menu/example/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:104:44)
    at Command.handleAction (/Users/sanajmi/workspace/menu/example/node_modules/@react-native-community/cli/build/index.js:186:23)
    at Command.listener (/Users/sanajmi/workspace/menu/example/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:394:28)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
saads-macbook-pro:example sanajmi$ 

Looking at react-native.config.js, I did see this:

      ios: {
        project: "ios/ReactTestApp-Dummy.xcodeproj",
      },

I tried changing the project path to iOS/MenuExample.xcworkspace and to ../node_modules/.generated/iOS/ReactTestApp.xcodeproj but neither worked.

Your environment

  • react-native-test-app version: 0.6.3
  • Tested platforms:
    • Android
    • iOS
    • macOS
    • Windows
  • System information:
    System:
      OS: macOS 11.4
      CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 921.95 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 16.4.0 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 7.18.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.10.1 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
      Android SDK:
        API Levels: 28, 29, 30
        Build Tools: 28.0.3, 29.0.3, 30.0.1
        System Images: android-30 | Google APIs Intel x86 Atom
        Android NDK: Not Found
    IDEs:
      Android Studio: 4.1.2 4.1.2
      Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
    Languages:
      Java: 11.0.1 - /usr/bin/javac
    npmPackages:
      @react-native-community/cli: Not Found
      react: 17.0.1 => 17.0.1 
      react-native: 0.64.1 => 0.64.1 
      react-native-macos: ^0.63.0 => 0.63.36 
    npmGlobalPackages:
      *react-native*: Not Found
    

Steps to reproduce

git clone git@github.com:react-native-menu/menu.git
cd menu
mv example/ example2/ # This is to just move the existing test app out of the way temporarily
yarn add react-native-test-app --dev
yarn init-test-app
# The options I chose
# ✔ What is the name of your test app? … MenuExample
# ✔ Which platforms do you need test apps for? › Android, iOS
# ✔ Where should we create the new project? … example
yarn
yarn build:ios
pod install --project-directory=iOS
yarn iOS
@tido64
Copy link
Member

tido64 commented Jun 27, 2021

Looks like this broke starting with v5.0.0-alpha.0 (react-native-community/cli#1270). A try-catch was removed from packages/platform-ios/src/link/warnAboutManuallyLinkedLibs.ts, causing the exception to bubble up and crash. Not exactly sure why it was removed in the first place since they were addressing an Android issue. Can you try opening an issue on their side?

@tido64 tido64 added bug Something isn't working platform: iOS This affects iOS platform: macOS This affects macOS upstream This should be fixed/reported upstream labels Jun 27, 2021
@tido64
Copy link
Member

tido64 commented Jun 27, 2021

I think this goes back to the feature request I filed last year: react-native-community/cli#1054

@Saadnajmi
Copy link
Collaborator Author

Looks like this broke starting with v5.0.0-alpha.0 (react-native-community/cli#1270). A try-catch was removed from packages/platform-ios/src/link/warnAboutManuallyLinkedLibs.ts, causing the exception to bubble up and crash. Not exactly sure why it was removed in the first place since they were addressing an Android issue. Can you try opening an issue on their side?

I take it that not using the cli-alpha will probably solve the error as well? It's probably an improvement to the community module if I specify it to use cli version ^4.10 anyway

@tido64
Copy link
Member

tido64 commented Aug 6, 2021

This should now be fixed in @react-native-community/cli-platform-ios@5.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working platform: iOS This affects iOS platform: macOS This affects macOS upstream This should be fixed/reported upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants