Home > Blockchain >  React Native app crashing on Proguard Enable
React Native app crashing on Proguard Enable

Time:12-26

I have a React-Native app which is working perfectly fine on debug. But the app doesn't open on release build.

Disabling proguard fixes the issue. So I started looking installation documentation for each third party package installed and my proguard rules seemed fine. Sadly I couldn't detect which package is creating the issue.

My question is : how can I detect which third party package is causing this issue ?

Dependencies :

{
  "dependencies": {
    "@gorhom/bottom-sheet": "^4.1.5",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/material-top-tabs": "^6.0.6",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "ky": "^0.28.7",
    "react": "^17.0.2",
    "react-native": "0.66.4",
    "react-native-android-location-enabler": "^1.2.2",
    "react-native-auto-height-image": "^3.2.4",
    "react-native-geolocation-service": "^5.3.0-beta.1",
    "react-native-gesture-handler": "^2.1.0",
    "react-native-image-crop-picker": "^0.36.0",
    "react-native-immersive-mode": "^2.0.0",
    "react-native-maps": "^0.29.4",
    "react-native-mmkv": "^1.5.4",
    "react-native-pager-view": "^5.4.9",
    "react-native-paper": "^4.11.1",
    "react-native-reanimated": "2.3.1",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.10.1",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "^9.0.0",
    "react-native-version-check": "^3.4.2",
    "react-query": "^3.34.5"
  },
}

Proguard Rules

-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }
-keep class com.facebook.react.turbomodule.** { *; }

CodePudding user response:

You can test the release build and find errors in the console.

https://reactnative.dev/docs/signed-apk-android#testing-the-release-build-of-your-app

  • Related