我是React Native和一般编程的新手,正在学习RN。一切都很好,但是突然我的项目无法打开。 npx react-native run-android
开始显示一些类似的行:
Jetifier found 967 file(s) to forward-jetify. Using 4 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
05:12:53 V/ddms: execute: running am get-config
05:12:56 V/ddms: execute 'am get-config' on 'fff70386' : EOF hit. Read: -1
05:12:56 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'SM-G600FY - 6.0.1' for app:debug
05:12:56 D/app-debug.apk: Uploading app-debug.apk onto device 'fff70386'
05:12:56 D/Device: Uploading file onto device 'fff70386'
05:12:56 D/ddms: Reading file permision of C:\Users\Bruno\React Native\Oner\android\app\build\outputs\apk\debug\app-debug.apk as: rwx------
05:13:03 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
05:13:31 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'fff70386' : EOF hit. Read: -1
05:13:31 V/ddms: execute: returning
05:13:31 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
05:13:31 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'fff70386' : EOF hit. Read: -1
05:13:31 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.0.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1m 50s
27 actionable tasks: 2 executed, 25 up-to-date
info Connecting to the development server...
info Starting the app on "fff70386"...
Starting: Intent { cmp=com.oner/.MainActivity }
npx react-native start
花费的时间如此之长,以至于它甚至没有开始加载具有更多代码而不仅仅是测试内容的应用程序。仍然是这样:https://prnt.sc/s3k7z6,但永远是0%(印刷品的应用只是“测试内容”)
我的应用程序屏幕仅显示以下内容:https://prnt.sc/s3kaxu
没有错误消息,只是没有打开。
我正在使用0.62版本,并在Windows 10中通过USB在手机上运行它。
有人可以帮忙吗?我浏览了整个互联网,但没有任何帮助。谢谢
编辑:我正在编写一些代码,以查看何时它会停止工作以及何时放置图像,它开始加载应用程序直至停止并停止,就像这样:https://prnt.sc/s41bp5
答案 0 :(得分:0)
run-android
命令将再次构建您的android项目。
如果您不需要重新构建(某些原因,例如本机库链接,gradle同步),只需打开模拟器并取消构建,然后在模拟器主屏幕中打开应用
答案 1 :(得分:0)
你可以使用
npx react-native run-android --no-jetifier
防止每次都一次又一次地将库迁移到AndroidX,这样会更快