leegeunhyeok / react-native-zendesk-messaging

🗣️ Zendesk messaging SDK for React Native
https://www.npmjs.com/package/react-native-zendesk-messaging
MIT License
40 stars 12 forks source link

I am trying to run react-native-zendesk-messaging on Android and the application is crashing in release mode when progaurd is enabled. #36

Closed anandsharmaautovyn closed 9 months ago

anandsharmaautovyn commented 10 months ago

Describe the bug when progaurd is enabled the application is crashing when calling method Zendesk.openMessagingView()

To Reproduce Steps to reproduce the behavior:

  1. Go to 'android\app\build.gradle'
  2. Scroll down to 'minifyEnabled enableProguardInReleaseBuilds'
  3. add shrinkResources true, minifyEnabled true
  4. see the error when you make release build and open the messaging activity using Zendesk.openMessagingView()

Expected behavior while these two shrinkResources true, minifyEnabled true are enabled the package should work as expected

Screenshots It's just keeps crashing the app even after reopening the app

Environment (please complete the following information):

anandsharmaautovyn commented 9 months ago

@leegeunhyeok any update as the application needs to be live in 2-3 days please reply ASAP.

leegeunhyeok commented 9 months ago

@anandsharmaautovyn

Add proguard rule to your proguard-rules.pro

-keepnames class zendesk.** { *; }

docs

anandsharmaautovyn commented 9 months ago

@leegeunhyeok it is still crashing can you please check it again?

anandsharmaautovyn commented 9 months ago

@leegeunhyeok I've added these rules also but the application is still crashing, I need to close this issue ASAP as the build is awaited for too long to go for the production. Rules I've applied are: -keep class zendesk.core.AuthenticationRequestWrapper { ; } -keep class zendesk.core.PushRegistrationRequestWrapper { ; } -keep class zendesk.core.PushRegistrationRequest { ; } -keep class zendesk.core.PushRegistrationResponse { ; } -keep class zendesk.core.ApiAnonymousIdentity { *; }

-keep class zendesk.support.CreateRequestWrapper { ; } -keep class zendesk.support.Comment { ; }

-keep class zendesk.answerbot.Deflection { ; } -keep class zendesk.answerbot.AnswerBotSettings { ; } -keep class com.zendesk. { *; } -keep interface com.zendesk.* { ; } -keepnames class zendesk. { *; }

leegeunhyeok commented 9 months ago

Can I get any crash logs?

anandsharmaautovyn commented 9 months ago

I didn't know how to get them

anandsharmaautovyn commented 9 months ago

can you tell me any way to get them as the application is crashing (it doesn't launch at all) in debug build if I enable the progaurd

leegeunhyeok commented 9 months ago

Are you using a monitoring solution in your app? (eg. Sentry, Firebase Crashlytics)

Without logs, it's hard to know what the problem is

anandsharmaautovyn commented 9 months ago

ok I'll add one and let you know