繁体   English   中英

React Native Metro Bundler 不会自动启动

[英]React Native Metro Bundler not starting automatically

我使用的是 Ubuntu 派生的 mx Linux。 尝试在 genymotion 中使用 react-native。 我想我做的所有安装都是正确的。

带有一些 SDK 的最新 Android 工作室。

配置的 PATH 像

    export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Nodejs 版本 10.21.0(也尝试过 12.4.0 和最新版本。但结果相同) npm 版本 5.8.0(尝试过最新版本但相同)

Genymotion 设置(对于 SDK 路径)是这样完成的

 /home/kaan/Android/Sdk/


    $ npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Installing the app...

> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.

> Task :app:installDebug
01:50:49 V/ddms: execute: running am get-config
01:50:49 V/ddms: execute 'am get-config' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:49 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Samsung Galaxy S6 - 5.0' for app:debug
01:50:49 D/app-debug.apk: Uploading app-debug.apk onto device '192.168.56.101:5555'
01:50:49 D/Device: Uploading file onto device '192.168.56.101:5555'
01:50:49 D/ddms: Reading file permision of /home/kaan/Rn/first/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
01:50:49 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
01:50:52 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:52 V/ddms: execute: returning
01:50:52 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
01:50:52 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:52 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 6s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
info Starting the app on "192.168.56.101:5555"...
Starting: Intent { cmp=com.first/.MainActivity }
kaan@development:~/Rn/first
$ 

这是结果。 Metro bundler 没有自动运行。

我开始 npx react-native start 它的工作但是当我更改某些内容时它不会更新,因为 npx react-native run-android 如您在顶部看到的那样完成。

以前有人遇到过这个问题吗? 任何人都可以解决这个问题?

我使用的是Ubuntu派生的mx Linux。 尝试对genymotion使用react-native。 我猜对了所有安装。

最新的Android Studio,带有一些SDK。

配置的路径像

    export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

Nodejs版本10.21.0(也尝试过12.4.0和最新版本,但结果相同)npm版本5.8.0(尝试了最新但相同)

Genymotion设置(对于SDK路径)是这样完成的

 /home/kaan/Android/Sdk/


    $ npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Installing the app...

> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.

> Task :app:installDebug
01:50:49 V/ddms: execute: running am get-config
01:50:49 V/ddms: execute 'am get-config' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:49 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Samsung Galaxy S6 - 5.0' for app:debug
01:50:49 D/app-debug.apk: Uploading app-debug.apk onto device '192.168.56.101:5555'
01:50:49 D/Device: Uploading file onto device '192.168.56.101:5555'
01:50:49 D/ddms: Reading file permision of /home/kaan/Rn/first/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
01:50:49 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
01:50:52 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:52 V/ddms: execute: returning
01:50:52 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
01:50:52 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on '192.168.56.101:5555' : EOF hit. Read: -1
01:50:52 V/ddms: execute: returning
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 6s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
info Starting the app on "192.168.56.101:5555"...
Starting: Intent { cmp=com.first/.MainActivity }
kaan@development:~/Rn/first
$ 

这就是结果。 Metro捆绑器未按自动运行。

我启动了npx react-native开始其工作,但是当我更改某些内容时,它并没有更新,因为npx react-native run-android已完成,如您在顶部看到的那样。

有人遇到过这个问题吗? 任何人都可以解决这个问题?

除了手动运行 Metro bundler 之外,没有其他解决方案。 谢谢!

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM