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

Android build failing in Expo App #24138

Closed
1 of 4 tasks
kalingaCoder opened this issue May 22, 2024 · 7 comments · Fixed by #26493
Closed
1 of 4 tasks

Android build failing in Expo App #24138

kalingaCoder opened this issue May 22, 2024 · 7 comments · Fixed by #26493
Assignees
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@kalingaCoder
Copy link

kalingaCoder commented May 22, 2024

Current Behavior

From the workspace folder: Run npx expo, select open Android by typing 'a'

  1. Android Bundling failed 3038ms (C:\code\dhrona_z\node_modules\expo\AppEntry.js)
    Unable to resolve "../../App" from "node_modules\expo\AppEntry.js"

  2. When scanned from expo go app, it shows the following error:
    The installed version of Expo go is for SDK 51, The project you open uses sdk 50.

Expected Behavior

  1. Android Build should have been successful & ran the application in Android studio.
  2. The generated app should have been compatible with the latest expo go app which is using sdk 51.

GitHub Repo

https://github.com/kalingaCoder/ExpoNx

Steps to Reproduce

1.create-nx-workspace@latest

NX Let's create a new workspace [https://nx.dev/getting-started/intro]

√ Where would you like to create your workspace? · og
√ Which stack do you want to use? · react
√ What framework would you like to use? · nextjs
√ Integrated monorepo, or standalone project? · integrated
√ Application name · nextApp
√ Would you like to use the App Router (recommended)? · Yes
√ Would you like to use the src/ directory? · Yes
√ Test runner to use for end to end (E2E) tests · none
√ Default stylesheet format · tailwind
√ Do you want Nx Cloud to make your CI fast? · skip

NX Creating your v19.0.5 workspace.

  1. nx add @nx/expo
  2. npx nx generate @nx/expo:application --name=expoApp --directory=./apps/expoApp --e2eTestRunner=none --projectNameAndRootFormat=as-provided --unitTestRunner=none --no-interactive
  3. nx install expoApp --check
    Downgraded react native svg package as per the reccommendation version & now nx install expoApp --check is successful without any recommendations.
  4. Added android package name in the app.json of expo app.
  5. npx expo --> throws error

Nx Report

Node   : 21.6.1
OS     : win32-x64
yarn   : 1.22.22

nx (global)        : 19.0.4
nx                 : 19.0.5
@nx/js             : 19.0.5
@nx/jest           : 19.0.5
@nx/linter         : 19.0.5
@nx/eslint         : 19.0.5
@nx/workspace      : 19.0.5
@nx/devkit         : 19.0.5
@nx/eslint-plugin  : 19.0.5
@nx/expo           : 19.0.5
@nx/react          : 19.0.5
@nrwl/tao          : 19.0.5
@nx/web            : 19.0.5
@nx/webpack        : 19.0.5
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/expo/plugin
@nx/eslint/plugin

Failure Logs

› Opening on Android...
› Opening exp://192.168.29.64:8082 on Pixel_5_API_34
√ Expo Go on Pixel_5_API_34 is outdated, would you like to upgrade? ... yes
Uninstalling Expo Go from android device Pixel_5_API_34.
› Press ? │ show all commands
Android Bundling failed 3038ms (C:\code\dhrona_z\node_modules\expo\AppEntry.js)
Unable to resolve "../../App" from "node_modules\expo\AppEntry.js"

Package Manager Version

No response

Operating System

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

Additional Information

Web build was successful.

@kalingaCoder
Copy link
Author

@xiongemi - If possible please provide the ETA So that I can plan accordingly

@xiongemi
Copy link
Collaborator

i checkout your repo, at workspace root, I ran nx start expoApp, then I enter a to run on android. it seems fine for me. i am able to launch your app in android emulator:

Screenshot_1716916650

@kalingaCoder
Copy link
Author

On executing the command it is directly opening the web in the browser it is not asking for Android.

_dhrona_z> nx start expoApp

nx run expoApp:start

expo start

Starting project at C:\code\dhrona_z\apps\expoApp
(node:16600) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Using src/app as the root directory for Expo Router.
Starting Metro Bundler
Waiting on http://localhost:8081
Logs for your project will appear below._

@xiongemi
Copy link
Collaborator

xiongemi commented Jun 6, 2024

the quick workaround would be add target to expoApp's project.json:

"targets": {
  "start": {
      "executor": "@nx/expo:start"
  }
}

then it could be run on windows for start command nx start expoApp
i will do a proper fix.

@kalingaCoder
Copy link
Author

Need solution for this issue aswell:
When scanned from expo go app, it shows the following error:
The installed version of Expo go is for SDK 51, The project you open uses sdk 50.

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 -->
- interactive command does not work on windows, use executor instead

## 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 #24138

(cherry picked from commit fe30d02)
@xiongemi
Copy link
Collaborator

Need solution for this issue aswell: When scanned from expo go app, it shows the following error: The installed version of Expo go is for SDK 51, The project you open uses sdk 50.

you can run nx migrate latest to upgrade your expo version

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 28, 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.

3 participants