简体   繁体   English

如何获取在启动时立即崩溃的 React Native Android 应用程序的崩溃日志

[英]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脚步

  1. I added Firebase following the official docs => I started getting an error with the dex archive (the 64k limit)我按照官方文档添加了 Firebase => 我开始遇到 dex 存档错误(64k 限制)
  2. I fixed it following these two links (the docs and a stackoverflow thread )我按照这两个链接(文档stackoverflow 线程)修复了它
  3. Now when I run npx react-native run-android , the build is successful but the app crashes immediately.现在,当我运行npx react-native run-android时,构建成功但应用程序立即崩溃。

Maybe important notes:也许重要的注意事项:

  • react-native version 0.61.5 react-native 版本0.61.5
  • I am using the same computer and phone to debug that I used just before adding firebase我正在使用与添加 firebase 之前使用的同一台计算机和电话进行调试
  • I added firebase crashalytics (always using the docs ) with firebase before trying it在尝试之前,我添加了 firebase crashalytics(始终使用文档)和 firebase
  • I am getting this warning before the build success message and I don't know if it may be related:我在构建成功消息之前收到此警告,我不知道它是否相关:
> 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.

相关问题 如何使反应原生 android 应用程序崩溃 - How to crash a react native android app Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android - Expo react-native app with firebase phone authentication works on web, error on ios simulator and crashes with no warning on Android 添加 firebase crashlytics 后,React 本机应用程序卡在启动屏幕上? - React native App get stuck at launch screen after adding firebase crashlytics? 在 ios 上上传图像时,本机应用程序崩溃且没有日志 - react native app is crashing with no logs when uploading image on ios android第二次打开app时开启skip login怎么还能得到email地址? - How can I still get the email address when I enabled skip login on the second launch of the app in android? NSInternalInconsistencyException:Firebase 在启动时崩溃 SwiftUI 应用程序 - NSInternalInconsistencyException: Firebase crashes SwiftUI app on launch 尝试使用本机反应将图像上传到 firebase 存储时,应用程序在 iOS 上崩溃 - App crashes on iOS when trying to upload image to firebase storage using react native 通过添加此行来应对本机应用程序崩溃:apply plugin: 'com.google.gms.google-services' - react native app crash by adding this line: apply plugin: 'com.google.gms.google-services' 如何在Android上用react-native-push-notification获取所有通知,相当于PushNotificationIOS getDeliveredNotifications? - How to get all notifications with react-native-push-notification on Android, equivalent to PushNotificationIOS getDeliveredNotifications? React Native 崩溃 - 灰色屏幕 - 仅限 App Center 构建 - com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(本地方法) - React Native Crash - Grey Screen - App Center build only - com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM