infobip / mobile-messaging-react-native-plugin

Mobile Messaging SDK plugin for React Native projects
24 stars 4 forks source link

Runtime Crash on Android Release Build #46

Closed ahadtechcarrot closed 1 year ago

ahadtechcarrot commented 1 year ago

Hi,

I am using :

"infobip-mobile-messaging-react-native-plugin": "6.1.0", "react-native": "0.63.3", "react": "16.13.1" In Debug the application is running fine and I am able to fetch notifications. But wheneve I am creating release builds, then after opening the release app it will immediately crash and I found the error log below for that :

--------- beginning of crash 2022-06-14 13:09:20.564 11667-11748/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules Process: com.Screens.stage, PID: 11667 java.lang.IllegalArgumentException: Configuration is invalid at org.infobip.reactlibrary.mobilemessaging.b.a(SourceFile:3) at org.infobip.reactlibrary.mobilemessaging.ReactNativeMobileMessagingModule.init(SourceFile:1)

Can anyone help regarding the above issue?

riskpp commented 1 year ago

Hi @ahadtechcarrot, could you please provide code-snippet, how are you calling the mobileMessaging.init

riskpp commented 1 year ago

Hello @ahadtechcarrot seems the proguard-rules is the reason of this error, somehow rules from the plugin weren't applied to the build. As a workaround you can copy-paste following proguard-rules to your file android/app/proguard-rules.pro:

-keep class org.infobip.reactlibrary.mobilemessaging.Configuration* { *; }
-keep class org.infobip.reactlibrary.mobilemessaging.CacheManager* { *; }
riskpp commented 1 year ago

@ahadtechcarrot how is it going? Did you manage to have it fixed?

ahadtechcarrot commented 1 year ago

@riskpp Sorry for my late response. I will try to use your provided proguard-rules and will let your know if it is working for me or not.

tjuric commented 1 year ago

Any updates from your side, @ahadtechcarrot?

riskpp commented 1 year ago

closing the issue because we didn't receive any response