react-native: App crashes on launch immediately without any error log

Old Version

0.72.3

New Version

0.73.0

Description

I upgraded all the libraries in my app and now when i run it in debug mode, it crashes immediately without any error log.

Here is my package.json:

{
  "name": "thefutureuniversity",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "cc": "rimraf node_modules/.cache/babel-loader/*,",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest",
    "postinstall": "patch-package",
    "bundleRelease": "cd android && ./gradlew bundleRelease && cd ..",
    "assembleRelease": "cd android && ./gradlew assembleRelease && cd .."
  },
  "dependencies": {
    "@azure/core-asynciterator-polyfill": "^1.0.2",
    "@heroicons/react": "^2.0.18",
    "@livekit/react-native": "^1.4.1",
    "@livekit/react-native-webrtc": "^114.0.0",
    "@notifee/react-native": "^7.8.0",
    "@openspacelabs/react-native-zoomable-view": "^2.1.1",
    "@react-native-async-storage/async-storage": "^1.21.0",
    "@react-native-community/cli-plugin-metro": "^12.3.0",
    "@react-native-firebase/analytics": "^18.7.1",
    "@react-native-firebase/app": "^18.7.1",
    "@react-native-firebase/auth": "^18.7.1",
    "@react-native-firebase/messaging": "^18.7.1",
    "@react-native/metro-config": "^0.73.2",
    "@react-navigation/material-bottom-tabs": "^6.2.19",
    "@react-navigation/material-top-tabs": "^6.6.5",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@sayem314/react-native-keep-awake": "^1.2.2",
    "@shopify/flash-list": "^1.6.3",
    "@types/react-native-snap-carousel": "^3.8.5",
    "appcenter": "5.0.0",
    "appcenter-analytics": "5.0.0",
    "appcenter-crashes": "5.0.0",
    "axios": "^1.4.0",
    "dayjs": "^1.11.7",
    "deprecated-react-native-prop-types": "^5.0.0",
    "jetifier": "^2.0.0",
    "mixpanel-react-native": "^2.3.1",
    "nativewind": "^2.0.11",
    "postcss": "^8.4.23",
    "react": "18.2.0",
    "react-hook-form": "^7.44.1",
    "react-native-appsflyer": "^6.12.2",
    "react-native-autolink": "^4.1.0",
    "react-native-code-push": "^8.1.0",
    "react-native-config": "^1.5.1",
    "react-native-confirmation-code-field": "^7.3.1",
    "react-native-gesture-handler": "^2.14.0",
    "react-native-image-picker": "^7.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.8.2",
    "react-native-pager-view": "^6.2.0",
    "react-native-paper": "^5.11.4",
    "react-native-pip-android": "^1.0.1",
    "react-native-razorpay": "^2.3.0",
    "react-native-reanimated": "^3.6.1",
    "react-native-render-html": "^6.3.4",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.5.3",
    "react-native-screens": "^3.29.0",
    "react-native-share": "^10.0.2",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-svg-transformer": "^1.2.0",
    "react-native-vector-icons": "^10.0.0",
    "react-native-webview": "^13.6.3",
    "react-native-youtube-iframe": "^2.3.0",
    "rn-fetch-blob": "^0.12.0",
    "sass": "^1.62.1",
    "swr": "^2.1.5",
    "text-encoding": "^0.7.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/cli-platform-android": "^12.3.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^3.0.2",
    "@types/jest": "^29.2.1",
    "@types/node": "^20.2.5",
    "@types/react": "^18.0.24",
    "@types/react-native-countdown-component": "^2.7.0",
    "@types/react-native-vector-icons": "^6.4.13",
    "@types/react-test-renderer": "^18.0.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.19.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "^0.77.0",
    "patch-package": "^8.0.0",
    "prettier": "^3.1.1",
    "react-native": "^0.73.0",
    "react-native-dotenv": "^3.4.8",
    "react-native-gradle-plugin": "^0.71.19",
    "react-test-renderer": "18.2.0",
    "tailwindcss": "^3.3.2",
    "typescript": "^5.3.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

Here is build.gradle // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { ext { buildToolsVersion = “33.0.0” minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 kotlinVersion = “1.8.0”

    // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
    ndkVersion = "23.1.7779620"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle:7.2.2")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath("com.google.gms:google-services:4.3.15")
}

}

Steps to reproduce

Install dependencies Run the app

Affected Platforms

Runtime - Android, Build - MacOS

Output of npx react-native info

info Fetching system and libraries information...
System:
  OS: macOS 14.1.2
  CPU: (8) arm64 Apple M1
  Memory: 164.72 MB / 8.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.7.0
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK: Not Found
  Android SDK:
    API Levels:
      - "29"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 34.0.0
    System Images:
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: /undefined
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.0
    wanted: ^0.73.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false


### Stacktrace or Logs

```text
> Task :app:installDebug
Installing APK 'app-debug.apk' on 'Resizable_Experimental_API_34(AVD) - 14' for :app:debug
Installed on 1 device.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 29s
574 actionable tasks: 15 executed, 559 up-to-date
info Connecting to the development server...
info Starting the app on "emulator-5554"...
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=university.thefuture/.MainActivity }
 BUNDLE  ./index.js 

 BUNDLE  ./index.js 

 BUNDLE  ./index.js 



### Reproducer

Unable to reproduce

### Screenshots and Videos

_No response_

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

check you have already apply Kotlin plugin in app/gradle.build

apply plugin: "org.jetbrains.kotlin.android"

I have the exact same issue. Upgraded to 0.73 and followed the upgrade diffs. Works fine on iOS and crashes immediately on launch with Android.

I solved it. For anyone else looking for this I accidentally left the wrong package in the top of MainActivity.kt

You can take the logs from here and paste it into ChatGPT if you need more help.

adb logcat | grep com.yourpackage

I solved it by commenting out this line: //ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); from MainApplication.java

check you have already apply Kotlin plugin in app/gradle.build

apply plugin: "org.jetbrains.kotlin.android"

Very thanks, this help me after upgrade RN 0.72-0.73, app build but crash on Android after start.

@marijache Hello, did you fix this? I am getting the same crash and same error in logcat. Trying to update my rn version from 0.72.3 to 0.73.2

  • Added plugin in app/gradle.build apply plugin: “org.jetbrains.kotlin.android”
  • cleaned gradlew

I’m having the same issue, i upgraded to 0.73.2 from 0.72, upgraded the project to gradle 8.1.1.

My app build is Successfull but the app crash when i open it

@marijache Hello, did you fix this? I am getting the same crash and same error in logcat. Trying to update my rn version from 0.72.3 to 0.73.2

Did you check logs in Android Studio’s Logcat? I often do that when Metro doesn’t show any logs during crashes. 99.9% chance you will see some useful log in Logcat that explains why the app crashes.