nx
nx copied to clipboard
@nx/expo install problem, pods not installed on ios
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
-
npx create-nx-workspace@latest --preset=expo --appName=expotest
, choose all defaults for prompts. -
nx run expotest:run-ios
- Observe project is built, pods are installed and it runs in simulator.
-
nx install expotest expo-dev-client
-
nx run expotest prebuild
, choose all defaults for prompts. -
nx run expotest:run-ios
- Observe project is built, pods are installed and it runs in simulator.
-
nx install expotest expo-build-properties @react-native-firebase/app
- 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
- Check ios/Pods directory, notice firebase pods are not installed.
- add
"@react-native-firebase/app": "*"
to project package.json -
nx run expotest:prebuild
-
nx run expotest:run-ios
- app builds and runs.
- 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
- [X] 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"
]
}
same +1
same +1
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
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.