-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cannot prebuild Expo app with brand new nx monorepo because Gradle expo-modules-core
#26285
Comments
expo-modules-core
I'm experiencing the same problem.
Migrating the same project to a single repo rather than a monorepo will cause prebuild to operate normally. But I can't just do prebuild. FYI, I'm using the exposdk 51 version, but the same problem occurs with the sdk 50 version. |
Just fixed the Android prebuild issue!!!!!!! Why it didn't buildError that occurred
Expo gets the version of The phrase 'build.gradle' in that part is: def getRNVersion() {
def nodeModulesVersion = providers.exec {
workingDir(projectDir)
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
}.standardOutput.asText.get().trim()
def version = safeExtGet("reactNativeVersion", nodeModulesVersion)
def coreVersion = version.split("-")[0]
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
return versionToNumber(
major,
minor,
patch
)
} The version is being imported by setting Why was the react-native dependency installed inside the package and not installed in root?If you use Yarn Workspaces monorepo, most of the dependencies are hoisted and installed in the root
If you look at react-native 0.74.1 package.json , |
Fantastic @milk717! Thanks for the explanation, good learning for me. Waiting for the next release. Expo and Nx is causing multiple problems explained here https://github.com/guillempuche/nx-expo-next-tamagui?tab=readme-ov-file#known-issues, and the benefit of using Expo CLI ( |
i created a pr to your repo: https://github.com/guillempuche/test-nx-expo/pull/1 what I did:
|
Works like a charm @xiongemi with React Native 0.74.2 and Expo 51. Hope the app's package.json will much cleaner after #26086. For the rest of people, apart from some Android folder changes, Emily modified the package.json to: {
"name": "expo",
"version": "0.0.1",
"private": true,
"dependencies": {
"@testing-library/jest-native": "*",
"@testing-library/react-native": "*",
"metro-config": "*",
"react-native": "*",
"expo": "*",
"react-native-svg": "*",
"react-native-web": "*",
"expo-dev-client": "~3.3.12",
"react": "18.2.0",
"expo-modules-core": "*",
"expo-dev-launcher": "*",
"expo-dev-menu": "*",
"expo-json-menu": "*",
"expo-json-utils": "*",
"expo-manifests": "*",
"expo-asset": "*",
"expo-font": "*"
},
"scripts": {
"eas-build-pre-install": "cd ../../ && node tools/scripts/eas-build-pre-install.mjs . apps/expo && cp package-lock.json apps/expo",
"eas-build-post-install": "cd ../../ && node tools/scripts/eas-build-post-install.mjs . apps/expo",
"android": "expo run:android",
"ios": "expo run:ios"
}
} @xiongemi, how Expo CLI https://docs.expo.dev/more/expo-cli/ can work with Nx? For example, Expo knows what dependency version to install for compatibility, |
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. |
Current Behavior
After creating a new expo monorepo with Nx v19.1.1, Gradle throws an error.
The only thing I updated is some Expo packages like
@expo/cli
,expo-dev-client
...Expected Behavior
Build the app locally on my Android emulator.
Haven't tested on iOS.
GitHub Repo
https://github.com/guillempuche/test-nx-expo
Steps to Reproduce
app.json
(username and EAS id)npx nx run expo:run-android
Nx Report
Failure Logs
Package Manager Version
npm v10.1.0
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: