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

@nx/expo install problem, pods not installed on ios #22393

Closed
1 of 4 tasks
alexstanbury opened this issue Mar 19, 2024 · 4 comments · Fixed by #26500
Closed
1 of 4 tasks

@nx/expo install problem, pods not installed on ios #22393

alexstanbury opened this issue Mar 19, 2024 · 4 comments · Fixed by #26500
Assignees
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@alexstanbury
Copy link

alexstanbury commented Mar 19, 2024

Current Behavior

I am trying to install a package, @react-native-firebase/app.

I run the command
nx install expotest @react-native-firebase/app

This is fine, it installs and shows in the workspace package.json.

However, it is not referenced in the app level package.json, and also the pods are not installed when running nx run expotest:prebuild then nx run expotest:run-ios

To resolve it, I have to manually add the package to the project package.json.

Is this the correct behaviour? Should @nx/expo be taking care of this for me instead?

Expected Behavior

package.json should be updated with the package name, or whatever the proper linking steps are to install the pods.

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest --preset=expo --appName=expotest, choose all defaults for prompts.
  2. nx run expotest:run-ios
  3. Observe project is built, pods are installed and it runs in simulator.
  4. nx install expotest expo-dev-client
  5. nx run expotest prebuild, choose all defaults for prompts.
  6. nx run expotest:run-ios
  7. Observe project is built, pods are installed and it runs in simulator.
  8. nx install expotest expo-build-properties @react-native-firebase/app
  9. add
"@react-native-firebase/app",
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]

to plugins in app.json as per https://rnfirebase.io/
10. nx run expotest:prebuild
11. nx run expotest:run-ios
12. Observe build error:

Planning build
› Executing react-native Pods/hermes-engine » [CP-User] [Hermes] Replace Hermes for the right configuration, if needed
› Preparing expo-constants Pods/EXConstants-EXConstants » ResourceBundle-EXConstants-EXConstants-Info.plist
› Preparing Pods/React-Core-RCTI18nStrings » ResourceBundle-RCTI18nStrings-React-Core-Info.plist
› Executing expo-constants Pods/EXConstants » [CP-User] Generate app.config for prebuilt Constants.manifest
› Executing Expotest » [Expo] Configure project
› Copying   ios/Expotest/GoogleService-Info.plist ➜ ./GoogleService-Info.plist
› Copying   ios/Expotest/Supporting/Expo.plist ➜ ./Expo.plist
› Compiling Expotest » SplashScreen.storyboard
› Compiling Expotest » AppDelegate.mm

❌  (ios/Expotest/AppDelegate.mm:2:9)

  1 | #import "AppDelegate.h"
> 2 | #import <Firebase/Firebase.h>
    |         ^ 'Firebase/Firebase.h' file not found
  3 | 
  4 | #import <React/RCTBundleURLProvider.h>
  5 | #import <React/RCTLinkingManager.h>


› 1 error(s), and 0 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
Warning: command "expo run:ios" exited with non-zero status code
  1. Check ios/Pods directory, notice firebase pods are not installed.
  2. add "@react-native-firebase/app": "*" to project package.json
  3. nx run expotest:prebuild
  4. nx run expotest:run-ios
  5. app builds and runs.
  6. Check ios/Pods directory, notice firebase pods are installed.

Nx Report

Node   : 18.19.0
OS     : darwin-arm64
npm    : 10.2.3

nx (global)        : 18.1.1
nx                 : 18.1.2
@nx/js             : 18.1.2
@nx/jest           : 18.1.2
@nx/linter         : 18.1.2
@nx/eslint         : 18.1.2
@nx/workspace      : 18.1.2
@nx/detox          : 18.1.2
@nx/devkit         : 18.1.2
@nx/eslint-plugin  : 18.1.2
@nx/expo           : 18.1.2
@nx/react          : 18.1.2
@nrwl/tao          : 18.1.2
@nx/web            : 18.1.2
@nx/webpack        : 18.1.2
typescript         : 5.3.3

Failure Logs

Planning build
› Executing react-native Pods/hermes-engine » [CP-User] [Hermes] Replace Hermes for the right configuration, if needed
› Preparing expo-constants Pods/EXConstants-EXConstants » ResourceBundle-EXConstants-EXConstants-Info.plist
› Preparing Pods/React-Core-RCTI18nStrings » ResourceBundle-RCTI18nStrings-React-Core-Info.plist
› Executing expo-constants Pods/EXConstants » [CP-User] Generate app.config for prebuilt Constants.manifest
› Executing Expotest » [Expo] Configure project
› Copying   ios/Expotest/GoogleService-Info.plist ➜ ./GoogleService-Info.plist
› Copying   ios/Expotest/Supporting/Expo.plist ➜ ./Expo.plist
› Compiling Expotest » SplashScreen.storyboard
› Compiling Expotest » AppDelegate.mm

❌  (ios/Expotest/AppDelegate.mm:2:9)

  1 | #import "AppDelegate.h"
> 2 | #import <Firebase/Firebase.h>
    |         ^ 'Firebase/Firebase.h' file not found
  3 | 
  4 | #import <React/RCTBundleURLProvider.h>
  5 | #import <React/RCTLinkingManager.h>


› 1 error(s), and 0 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
Warning: command "expo run:ios" exited with non-zero status code

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

This happens with other packages (such as react-native-reanimated) so it doesn't appear to be specific to the @react-native-firebase package.

Interestingly, running nx install expotest react-native-vision-camera outputs the following log:

> nx run expotest:install react-native-vision-camera

› Installing 1 other package using npm
> npm install --save react-native-vision-camera

added 1 package, and audited 1929 packages in 3s

236 packages are looking for funding
  run `npm fund` for details

7 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

**No Expo config was found. Please create an Expo config (app.json or app.config.js) in your project root.
Please add the following to your Expo config**

{
  "plugins": [
    "react-native-vision-camera"
  ]
}

@FrozenPandaz FrozenPandaz added the scope: react-native Issues relating to React Native label Mar 27, 2024
@CoSNaYe
Copy link

CoSNaYe commented Apr 30, 2024

same +1

@ozergul
Copy link

ozergul commented May 3, 2024

same +1

@xiongemi
Copy link
Collaborator

i think you need to explicitly add packages to project root's package.json's dependencies:

"expotest": "*",
"expo-build-properties": "*",
"@react-native-firebase/app": "*"

I submit a pr to add to project's package.json when running nx install --packages=expotest,expo-build-properties,@react-native-firebase/app

FrozenPandaz pushed a commit that referenced this issue Jun 21, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #22393

(cherry picked from commit 5646b38)
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@alexstanbury @FrozenPandaz @ozergul @CoSNaYe @xiongemi and others