简体   繁体   English

无法将 Android 模拟器连接到 React Native 调试器

[英]Unable to connect Android emulator to React Native debugger

I am unable to connect android emulator with react native debugger.我无法将 android 模拟器与 react native 调试器连接起来。

When I run react-native run-android , it brings up the app successfully without showing any errors.当我运行react-native run-android ,它成功启动了应用程序而没有显示任何错误。 It also brings up node Metro Bundler as well.它还带来了节点 Metro Bundler。 But it didn't print any logs in RN debugger.但它没有在 RN 调试器中打印任何日志。 When I press Reload app on the page, it shows the following popup error:当我在页面上按重新加载应用程序时,它显示以下弹出错误:

React Native: No apps connected React Native:没有连接应用程序
Sending 'reload' to all React Native apps failed.向所有 React Native 应用程序发送“重新加载”失败。 Make sure your app is running in the simulator or on a phone确保您的应用程序在模拟器或手机上运行

Popup error when press on RN debugger "Reload app" button按 RN 调试器“重新加载应用程序”按钮时弹出错误

I tried running this adb reverse tcp:8081 tcp:8081 but it doesn't work.我尝试运行这个adb reverse tcp:8081 tcp:8081但它不起作用。 When I press Cmd+m in my emulator, it is showing multi-touch.当我在模拟器中按 Cmd+m 时,它显示多点触控。 So I can't open developer menu as well.所以我也无法打开开发者菜单。

unintentional triggered when pressed Cmd+m按下 Cmd+m 时无意触发

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 60.96 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.12.0 - /usr/local/bin/node
    npm: 6.12.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: ^0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1

How can I resolve this?我该如何解决这个问题?

Emulator means real device or Android studio?模拟器是指真机还是安卓工作室?

if you are trying to connect emulator from android studio please uninstall the device and install the Pixel 2 it may help you.如果您尝试从 android studio 连接模拟器,请卸载设备并安装 Pixel 2,它可能对您有所帮助。

And Uninstall the React native debugger and install the latest one并卸载 React Native 调试器并安装最新的

The problem was that page was not loading properly after my RN version update from 0.59 to 0.6.问题是在我的 RN 版本从 0.59 更新到 0.6 后,页面没有正确加载。 I believe it has some other issues as well since I haven't tested in android from the very beginning.我相信它还有一些其他问题,因为我从一开始就没有在 android 中进行过测试。 So, I just created a fresh project and imported all the files manually.所以,我刚刚创建了一个新项目并手动导入了所有文件。 Might not be the answer which you are looking for but that solved the problem.可能不是您正在寻找的答案,但解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在 React Native for Android 中连接到开发服务器 - Unable to connect to development server in React Native for Android 使用 React native 从 Android 仿真器连接到 Scala Websocket - Connect to Scala Websocket from Android Emulator with React native Android 模拟器无法连接到 Flipper - Android Emulator unable to connect to Flipper 无法将 android 仿真器与 flutter 连接 - Unable to connect android emulator with flutter React-Native build in Visual Studio Code 无法连接远程调试器超时,同时连接到 windows 中的远程调试器 - React-Native build in Visual Studio Code unable to connect with remote debugger timeout while connecting to remote debugger in windows React Native - Android 仿真器设备 - React Native - Android Emulator Device React Native 未检测到 Android 模拟器 - React Native not detecting Android emulator 在Android Studio模拟器上反应原生 - React Native on Android Studio Emulator 调试器似乎无法连接到Android FM应用程序 - Debugger seems to be unable to connect to Android FM Application 无法连接到 Visual Studio 2019 for mac 中的调试器 android 仿真器 - Could not connect to the debugger android emulator in visual studio 2019 for mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM