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

(INFO | Storing crashdata in: C:\Users\<>\AppData Problems running react-native android, caused by the emulator. (Windows) #44940

Closed
PedroEliasCS opened this issue Jun 13, 2024 · 2 comments
Labels
Newer Patch Available Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer

Comments

@PedroEliasCS
Copy link

Description

With the update with the emulator, it is returning undue information, causing an error when giving the command to activate it.

  1. Install latest version of Android Studio.
  2. Create any Android emulator.
  3. Run the command npx @react-native-community/cli@latest init AwesomeProject in your cmd
  4. cd AwesomeProject
  5. yarn or npm install (Confirm correct installation.)
  6. yarn start
    I get the error:
    Failed to launch emulator. Reason: INFO | Storing crashdata in: C:\Users\<>\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.15.db, detection is enabled for process: 15122

The reason for receiving it is an error in the latest version of the emulator that is caught by the react function:

const emulatorCommand =
  process.env.ANDROID_HOME != null
    ? `${process.env.ANDROID_HOME}/emulator/emulator`
    : 'emulator';

const getEmulators = () => {
  const emulatorsOutput = exec(`${emulatorCommand} -list-avds`).stdout;
  return emulatorsOutput.split(os.EOL).filter(name => name !== '');
};

Located in the archive: github react-native

Could anyone help me with this?

Steps to reproduce

  1. Install latest version of Android Studio.
  2. Create any Android emulator.
  3. Run the command npx @react-native-community/cli@latest init AwesomeProject in your cmd
  4. cd AwesomeProject
  5. yarn or npm install (Confirm correct installation.)
  6. npx react-native doctor
  7. At this point it will say that there is no ADB configured.
  8. By pressing F, we will see the problem there is a ghost emulator configured.
    Emulator INFO | Storing crashdata in: C:\Users\<user>\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.15.db, detection is enabled for process: 19272 (disconnected)

React Native Version

0.73.0

Affected Platforms

Runtime - Android, Build - Windows

Output of npx react-native info

System:
  OS: Windows 11 10.0.22631
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-11390H @ 3.40GHz
  Memory: 3.50 GB / 15.74 GB
Binaries:
  Node:
    version: 20.10.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 10.2.5
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "34"
      - "34"
      - "34"
    Build Tools:
      - 33.0.1
      - 34.0.0
    System Images:
      - android-28 | Google Play Intel x86 Atom
      - android-34 | Intel x86_64 Atom
      - android-34 | Google APIs Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-233.14808.21.2331.11709847
  Visual Studio: Not Found
Languages:
  Java: 17.0.8
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.0
    wanted: 0.73.0
  react-native-windows: Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

$ react-native run-android
info Launching emulator...
error Failed to launch emulator. Reason: The emulator (INFO    | Storing crashdata in: C:\Users\<>\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.15.db, detection is enabled for process: 8516) quit before it finished opening. You can try starting the emulator manually from the terminal with: C:\Users\<>\AppData\Local\Android\Sdk/emulator/emulator @INFO    | Storing crashdata in: C:\Users\<>\AppData\Local\Temp\\AndroidEmulator\emu-crash-34.2.15.db, detection is enabled for process: 8516.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :app:installDebug FAILED
115 actionable tasks: 2 executed, 113 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 4s
error Failed to install the app. Make sure you have an Android emulator running or a device connected.
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.

Reproducer

https://github.com/PedroEliasCS/react-native-error

Screenshots and Videos

image
image

Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@github-actions github-actions bot added the Platform: Android Android applications. label Jun 13, 2024
@cortinico
Copy link
Contributor

Located in the archive: github react-native

This is the script we use for release testing and is not the code is executed when you run yarn android. That code lives inside

https://github.com/react-native-community/cli

So please open this issue against:
https://github.com/react-native-community/cli/issues

Also in this last error screenshot, you can see that the error it says is "No connected devices". So it means your system is not configured properly for Android development.

Are you able to see your device if your adb devices in a console?

I'm closing as this is not a bug in React Native. You can get better support on https://github.com/react-native-community/cli/issues or StackOverflow

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Triage 🔍 labels Jun 14, 2024
@PedroEliasCS PedroEliasCS changed the title Problems running react-native android, caused by the emulator. (Windows) (INFO | Storing crashdata in: C:\Users\<>\AppData Problems running react-native android, caused by the emulator. (Windows) Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Newer Patch Available Platform: Android Android applications. Resolution: Answered When the issue is resolved with a simple answer
Projects
None yet
Development

No branches or pull requests

2 participants