react / react/react-native

Device need connect to run App in debug mode(Android)

未关闭
#58,191 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Needs: Attention Needs: Repro Platform: Android
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

Previous version with React Native 0.81.4: Once I installed the app and configured the bundle, I could disconnect the device from the USB cable or wireless connection and still run/debug the app and make code changes. This functionality has completely stopped in the latest React Native 0.87.1 version. Please fix this.

The scenario I am facing is mentioned below.

Upgrade from React Native 0.81.4 to 0.87

Previously, when we installed the debug APK on the phone, Metro would start and the app would connect to Metro automatically. The app could start even without a USB or wireless connection.

After upgrading from React Native 0.81.4 to 0.87, the behavior has changed.

  1. Metro Connection Requirement

After the upgrade:

The app starts only when either USB debugging or wireless debugging is connected.
If neither USB nor wireless debugging is connected, Metro starts, but the app does not start/connect properly.
2. Bundle Configuration Behavior

Previously, when we configured the bundle while USB and wireless connections were not available:

The app would not start immediately after configuring the bundle.
We could kill the app and reopen it.
On reopening, the app would start successfully.
The configured values would be saved and retained.

After upgrading to React Native 0.87:

We configure the bundle, but the app does not start.
We kill the app and reopen it.
The app again asks us to configure the bundle.
After configuring the bundle again, the app still does not start.
The configured values are not being retained as expected.
3. Behavior When USB/Wireless Is Connected

When either USB or wireless debugging is connected:

The app starts successfully.
After killing the app and opening it again, the app starts successfully on the second attempt.
Summary

The main issue after upgrading from React Native 0.81.4 to 0.87 is that the debug APK now appears to depend on an active USB or wireless Metro connection to start correctly. In addition, when Metro is not connected, the configured bundle values are not being retained after restarting the app.

Steps to reproduce
  • create new react-native project with version 0.87.X and check
  • App install and with usb cable
  • now remove usb cable and configure bundler
  • Kill App and open Again
  • it will not open
  • if usb and wireless dissconnected app will not start , it will ask to bundle configure after bundle configure also app not start , kill ask again to bundle configure and repeat same steps again and again
React Native Version

0.87.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
latest react-native version and CLI
Stacktrace or Logs
Stuck on first line and no going ahead
MANDATORY Reproducer

https://github.com/sandeepkudalepanvel-commits/SocietyMobileApp

Screenshots and Videos

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从必需的复现步骤开始,在断开 USB 和无线调试的情况下,对比 React Native 0.81.4 和 0.87.1 中的 Android 调试启动过程。跟踪报告中描述的 Metro 连接和 bundle 配置流程。完成的标准是:调试应用在没有这两种连接的情况下启动,并且在被终止后重新打开时仍保留其已配置的 bundle 值。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
需要澄清
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。