android - React Native 不适用于 Android 设备的“入门”指南
问题描述
我一直在尝试在我的 Windows PC 上启动并运行基本的 React Native 程序,但无法在通过 USB 连接的 Pixel 3 上加载它。我已将 Node.js 全新安装到 12.13.1。这是我做的时候得到的npx react-native run-android
PS C:\Users\davidc\Working\AwesomeProject> npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 864 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Installing the app...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
> Task :app:installDebug
03:53:33 V/ddms: execute: running am get-config
03:53:33 V/ddms: execute 'am get-config' on '891X0457A' : EOF hit. Read: -1
03:53:33 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel 3 - 10' for app:debug
03:53:33 D/app-debug.apk: Uploading app-debug.apk onto device '891X0457A'
03:53:33 D/Device: Uploading file onto device '891X0457A'
03:53:33 D/ddms: Reading file permision of C:\Users\davidc\Working\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
03:53:34 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
03:53:37 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '891X0457A' : EOF hit. Read: -1
03:53:37 V/ddms: execute: returning
03:53:37 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
03:53:37 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '891X0457A' : EOF hit. Read: -1
03:53:37 V/ddms: execute: returning
Installed on 1 device.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 32s
27 actionable tasks: 27 executed
info Connecting to the development server...
8081
info Starting the app on "891X0457A"...
Starting: Intent { cmp=com.awesomeproject/.MainActivity }
PS C:\Users\davidc\Working\AwesomeProject>
这就是我能做到的。我的手机说它无法加载脚本,并确保 Metro 服务器正在运行或 index.android.bundle 已正确打包。有什么建议么?
解决方案
推荐阅读
- python - 如何使用 Python 将文件从 AWS S3 发送/复制/上传到 Google GCS
- php - 确定逻辑以在 bootsrap 中水平分解卡片
- html - 如何隐藏两个单元格之间的边界,同时保持它们分开?
- python - 似乎无法从 Pycharm 中的 PYQT5 获得窗口(macOS Big Sur)
- freemarker - 用单个配额包装所有字符串
- pytorch - 读取 resnet18 的测试图像
- kubernetes - 无法在 Kubernetes 环境中创建 ALBIngressController
- opencv - qt.qpa.xcb:在 ec2 ubuntu 服务器 20.0 上使用 OpenCV 时无法连接到 displayerror
- python - 如何模拟等待pip模块的等待方法
- nginx - nginx 将一个 url 重定向到一个完全不同的模式