[英]How to get crash logs for a React Native Android app that crashes immediately on launch
I am developing and android app using react-native. Everything was normal until today我正在使用 react-native 开发和 android 应用程序。直到今天一切正常
STEPS脚步
npx react-native run-android
, the build is successful but the app crashes immediately.npx react-native run-android
时,构建成功但应用程序立即崩溃。 Maybe important notes:也许重要的注意事项:
0.61.5
0.61.5
> Task :app:installDebug
07:48:13 V/ddms: execute: running am get-config
07:48:14 V/ddms: execute 'am get-config' on 'GBT4C18C21006873' : EOF hit. Read: -1
07:48:14 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'JSN-L22 - 10' for app:debug
07:48:14 D/app-debug.apk: Uploading app-debug.apk onto device 'GBT4C18C21006873'
07:48:14 D/Device: Uploading file onto device 'GBT4C18C21006873'
07:48:14 D/ddms: Reading file permision of /PATH/TO/PROJECT/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
07:48:15 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
07:48:18 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'GBT4C18C21006873' : EOF hit. Read: -1
07:48:18 V/ddms: execute: returning
07:48:18 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
07:48:18 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'GBT4C18C21006873' : EOF hit. Read: -1
07:48:18 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
I fixed it !我修好了它 !
Thanks to @Guy Incognito who commented my question.感谢@Guy Incognito 评论了我的问题。
The key is to use adb logcat
on a terminal and executing npx react-native run-android
in another terminal.关键是在终端上使用
adb logcat
并在另一个终端上执行npx react-native run-android
。 You get a lot of logs from your phone but if you track the exact second in which the build occurred you can easily find the error message and fix it !您从手机中获得了大量日志,但如果您跟踪构建发生的确切秒数,您可以轻松找到错误消息并修复它!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.