简体   繁体   中英

npx react-native start AND npx react-native run-android ARE TOO SLOW

I am new to React Native and to programming in general and was learning RN. Everything was ok, but suddenly my projects would just not open. The npx react-native run-android started to show some different lines like that:

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 }

And the npx react-native start takes so long that it doesn't even start to load an app that has more code than just testing stuff. It stays like that: https://prnt.sc/s3k7z6 , but with 0% forever (the print's app is just 'testing stuff')

And my app screen does nothing but show this: https://prnt.sc/s3kaxu

There are no error messages, it just doesn't open.

I'm using the 0.62 version and running it on my phone via USB in a windows 10.

Can anyone help? I've looked through the entire internet and nothing has helped. Thanks

Edit: I was writing some code to see when it would stop working and when I put an Image it started to load the app until a point and stop, just like that: https://prnt.sc/s41bp5

You don't need rebuild apk again for your debugging. Just launch the emulator and launch previously installed application in home screen

run-android command will build your android project again. If you don't need re-build (some reason like native library link, gradle sync) , just open the emulator and cancel building and open your app in emulator home screen

you can use

npx react-native run-android --no-jetifier

to prevent migrate libraries to AndroidX again and again every time, it will be faster

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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