android React本机Metro Bundler未自动启动

ioekq8ef  于 2023-03-27  发布在  Android
关注(0)|答案(2)|浏览(148)

我使用的是mx Linux,这是Ubuntu的衍生。尝试使用react-native与genymotion。我做了所有的安装权利,我想。
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 bundler没有自动运行aspected。
我启动了npx react-native,开始工作,但是当我改变一些东西时,它没有更新,因为npx react-native run-android完成了,正如你在上面看到的。
以前有人遇到过这个问题吗?有人能解决这个问题吗?

osh3o9ms

osh3o9ms1#

你试过在不同的端口运行打包器吗?如果没有,试试这个
在不同端口上运行打包程序

npx react-native start --port 8084 --reset-cache

在那次运行之后

react-native run-android --port 8084

在第二个命令提示符窗口中。
如果不行就告诉我。

xmakbtuz

xmakbtuz2#

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

相关问题