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

Local EAS Android build gets stuck on Task :app:createBundleReleaseJsAndAssets #1804

Closed
modelorona opened this issue Apr 20, 2023 · 7 comments
Labels
eas build incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues invalid issue: project specific issue This issue is not an issue with EAS

Comments

@modelorona
Copy link

Build/Submit details page URL

No response

Summary

When I run the command eas build --platform android --local --profile staging --non-interactive, the build gets stuck on Task :app:createBundleReleaseJsAndAssets, specifically on [RUN_GRADLEW] info Done copying assets.

When I cancel it, an error message is printed that states Error: package.json does not exist in /tmp/ubuntu/eas-build-local-nodejs/cbdd028b-bc78-4a31-ba86-fe6e97ae1b88/build/ui.

This happens on my computer as well as my teammate. We've tried a mix of EAS cli versions but the issue remains. Local builds used to work but suddenly stopped.

The eas.json config for the staging profile is:

"staging": {
      "env": {
          "ENV_1": "x",
          "ENV_2": "y"
      }

One thing we noted was that if the configuration had the below code, it would not hang and would create the apk file:
"developmentClient": true

Managed or bare?

Bare

Environment

expo-env-info 1.0.5 environment info:
    System:
      OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
      Shell: 5.1.16 - /bin/bash
    Binaries:
      Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v18.14.0/bin/yarn
      npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
    SDKs:
      Android SDK:
        API Levels: 29, 30, 31, 32, 33
        Build Tools: 30.0.2, 30.0.3, 31.0.0, 33.0.0
        System Images: android-26 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Google APIs Intel x86_64 Atom
    npmPackages:
      expo: ~48.0.11 => 48.0.11 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.71.6 => 0.71.6 
      react-native-web: ~0.18.10 => 0.18.12 
    npmGlobalPackages:
      eas-cli: 3.8.1
      expo-cli: 6.3.6
    Expo Workflow: bare

Error output

[RUN_GRADLEW] Error: Gradle build failed with unknown error. See logs for the "Run gradlew" phase for more information.
[ON_BUILD_ERROR_HOOK] 
Error: package.json does not exist in /tmp/ubuntu/eas-build-local-nodejs/cbdd028b-bc78-4a31-ba86-fe6e97ae1b88/build/ui
    at readPackageJson (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/utils/project.js:52:15)
    at runHookIfPresent (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/utils/hooks.js:25:55)
    at /home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/common.js:21:52
    at BuildContext.runBuildPhase (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/context.js:83:34)
    at runBuilderWithHooksAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/common.js:20:23)
    at async Object.androidBuilder (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/android.js:15:12)
    at async buildAndroidAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/android.js:62:12)
    at async buildAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/build.js:39:29)
    at async main (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/main.js:16:9)
[ON_BUILD_COMPLETE_HOOK] 
Error: package.json does not exist in /tmp/ubuntu/eas-build-local-nodejs/cbdd028b-bc78-4a31-ba86-fe6e97ae1b88/build/ui
    at readPackageJson (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/utils/project.js:52:15)
    at runHookIfPresent (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/utils/hooks.js:25:55)
    at /home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/common.js:27:52
    at BuildContext.runBuildPhase (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/context.js:83:34)
    at runBuilderWithHooksAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/common.js:26:23)
    at async Object.androidBuilder (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/@expo/build-tools/dist/builders/android.js:15:12)
    at async buildAndroidAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/android.js:62:12)
    at async buildAsync (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/build.js:39:29)
    at async main (/home/ubuntu/.npm/_npx/ac2fe9123ebf2e7d/node_modules/eas-cli-local-build-plugin/dist/main.js:16:9)

Build failed

Reproducible demo or steps to reproduce from a blank project

Using a basic eas.json config for staging with just two environment variables:

"staging": {
      "env": {
          "ENV_1": "x",
          "ENV_2": "y"
      }

run:
eas build --platform android --local --profile staging --non-interactive

and it gets stuck on:
[RUN_GRADLEW] info Done copying assets

@modelorona modelorona added the needs review Issue is ready to be reviewed by a maintainer label Apr 20, 2023
@dsokal dsokal added incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues invalid issue: project specific issue This issue is not an issue with EAS eas build and removed needs review Issue is ready to be reviewed by a maintainer labels Apr 21, 2023
@expo-bot
Copy link
Contributor

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@bala2excel
Copy link

@modelorona , were you able to get the issue fixed?

@frank-borkin
Copy link

Affecting me too since I switched the build host from OSX to Ubuntu.
Love the fact that you just closed the ticket within 24 hours without comment.

@frank-borkin
Copy link

TL;DR: you've been bitten by this: expo/expo#24952
Add this to the bottom of your package.json:
"resolutions": {
"@expo/cli": "^0.15.0"
}
It will stop the hang and give you a nice dump of the actual problem (which in my case turned out to be a plugin which was looking for package.json in the lib folder instead of the module root)

@modelorona
Copy link
Author

modelorona commented Feb 6, 2024

@modelorona , were you able to get the issue fixed?

hey @bala2excel sorry I saw this quite late, I moved away from the expo project altogether so I don't have a resolution.

@AizenSousuke
Copy link

anyone else figured the issue?

@grimz11
Copy link

grimz11 commented May 22, 2024

We have a similar issue but mine was because of stripAnsi

> Task :app:createBundleReleaseJsAndAssets FAILED
/home/expo/workingdir/build/apps/higala-pay/node_modules/metro/src/lib/reporting.js:15
const stripAnsi = require("strip-ansi");
                  ^

Package Versions

"expo": "49.0.22",
"react": "18.2.0",
"react-native": "0.72.10",
"metro": "0.76.7",
"metro-config": "^0.80.8",
"metro-react-native-babel-transformer": "^0.77.0",
"metro-resolver": "0.76.7",

I solved this by adding this in package.json. If you are using a monorepo(NX console), add it also in the package.json

  "resolutions": {
    "wrap-ansi": "7.0.0",
    "string-width": "4.1.0"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eas build incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues invalid issue: project specific issue This issue is not an issue with EAS
Projects
None yet
Development

No branches or pull requests

7 participants