简体   繁体   English

React-Native 物理设备未连接到服务器

[英]React-Native physical device not connecting to server

Here's whats happening- react-native run-android fails giving the following error message- " Execution failed for task ':app:installDebug'.这是发生的事情 - react-native run-android 失败并给出以下错误消息 - “任务':app:installDebug'的执行失败。

com.android.builder.testing.api.DeviceException: No connected devices! com.android.builder.testing.api.DeviceException:没有连接的设备!

" "

Here's a list of things i have done-这是我做过的事情的清单-

  1. Connected my phone (Redmi Note 7 pro) to the laptop (uses ubuntu 18.04) using a usb cable.使用 usb 电缆将我的手机(Redmi Note 7 pro)连接到笔记本电脑(使用 ubuntu 18.04)。 And followed all instructions from the react-native documentation (USB debugging etc) but the device (phone) doesnt show on using the command adb devices .并遵循 react-native 文档(USB 调试等)中的所有说明,但使用命令adb devices时设备(电话)未显示。 I have also tried connecting the phone as a file transfer device and every other mode possible.我还尝试将手机连接为文件传输设备和其他所有可能的模式。
  2. I have tried connecting via the wifi network (which works) but the last time i did it i had to turn off MIUI optimisation, and this led to whatsapp going haywire and i had to reinstall whatsapp.我曾尝试通过 wifi 网络连接(有效),但上次我这样做时我不得不关闭 MIUI 优化,这导致 whatsapp 失控,我不得不重新安装 whatsapp。 From what i know this is a necessary condition, if wireless connection is to be made to an MI phone.据我所知,如果要与 MI 手机建立无线连接,这是一个必要条件。
  3. Android emulator..... simply doesnt work (i have tried many SO tricks, none worked). Android 仿真器.....根本不起作用(我尝试了许多 SO 技巧,但没有一个起作用)。

So is there a way to solve these issues?那么有没有办法解决这些问题呢? or is there any other method using which i can run my react-native application for debugging.或者是否有任何其他方法可以让我运行我的 react-native 应用程序进行调试。

Thanks in advance:)提前致谢:)

Ensure that Developer mode is enabled with USB debugging in the device.确保使用设备中的 USB 调试启用开发人员模式。 If USB debugging is enabled then the device id should be listed in the adb devices list.如果启用了 USB 调试,则设备 ID 应列在adb devices列表中。 If not then try to add ADB driver for the device or a universal ADB driver.如果没有,请尝试为设备添加 ADB 驱动程序或通用 ADB 驱动程序。

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

相关问题 无法在物理Android设备上重新加载我的React-native应用程序 - Cant reload my React-native app on physical android device 如何强制 react-native 项目在物理 android 设备上运行? - How to force react-native project to run on a physical android device? Android物理Android设备中的React-Native性能降低 - React-Native Slow Performance in Physical Android Device 在物理设备而非模拟器上运行时,React-Native应用程序崩溃 - React-Native Application is crashing when running on physical device but not simulator react-native helow world 应用程序 - 在模拟器中工作但不在物理设备中 - react-native hellow world app - working in emulator but not in physical device Android物理Android设备中的React-Native应用程序崩溃(按Dev设置时) - React-Native App Crashes in Physical Android Device (When Dev Settings Pressed) https Android react-native 连接在构建后无法在物理设备上工作 - https connection in Android react-native not working on physical device after build 带有react-native的Android应用程序可以在模拟器上运行,但不能在物理设备上运行 - Android app with react-native works on emulator but doesn't on physical device 摇动手势不适用于具有本机反应的物理设备 - Shake gesture not working on physical device with react native React Native 应用程序未在物理设备上运行 - React Native app is not running on physical device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM