4

I am developing and android app using react-native. Everything was normal until today

STEPS

  1. I added Firebase following the official docs => I started getting an error with the dex archive (the 64k limit)
  2. I fixed it following these two links (the docs and a stackoverflow thread)
  3. Now when I run npx react-native run-android, the build is successful but the app crashes immediately.

Maybe important notes :

  • react-native version 0.61.5
  • I am using the same computer and phone to debug that I used just before adding firebase
  • I added firebase crashalytics (always using the docs) with firebase before trying it
  • 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
Ryan M
  • 18,333
  • 31
  • 67
  • 74
Fayçal Borsali
  • 402
  • 4
  • 17

1 Answers1

5

I fixed it !

Thanks to @Guy Incognito who commented my question.

The key is to use adb logcat on a terminal and executing npx react-native run-android in another terminal. 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 !

Fayçal Borsali
  • 402
  • 4
  • 17