'MSAL is not working on Android Release build - react native

I am trying to test Android release build with MSAL custom login page, which works fine on debug mode. Though, on release mode, I am getting this error:

Could not invoke "RNMSAL.createPublicClientApplication"
    at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:192)
    at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)
    at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
    at android.os.Looper.loop(Looper.java:223)
    at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run

I checked everywhere but no compatible solution.

Here are my configurations for msal_Config.json:

{
  "client_id": "My_client-id",
  "authorization_user_agent": "DEFAULT",
  "redirect_uri": "msauth://com.myPackegeName/M74kWwKnLGHKWweswsUc5csggBRxjM%3D",
  "account_mode": "MULTIPLE",
  "broker_redirect_uri_registered": false,
  "authorities" : [
    {
      "type": "B2C",
      "authority_url": "https://domain.b2clogin.com/tfp/compnay.onmicrosoft.com/",
      "default": true
    }
  ]

}
 

And msalConfig.json

export const b2cConfig: B2CConfiguration = {
  auth: {
       clientId: 'My_client-id',
       authorityBase: 'https://domain.b2clogin.com/tfp/****.onmicrosoft.com',
       policies: {
               signInSignUp: 'B2C_1_SignUp_SignIn',
               passwordReset: 'B2C_1_pwd_reset'
              },
       },
   cache: { cacheLocation: 'localStorage' },
};

export const b2cScopes = ['https://domain.onmicrosoft.com/api/demo.read'];

Followed these commands to generate release bundle for Play Store: Publish App on Google Play

Does anybody know, do we need different MSAL configurations (new app registration) for Production mode as discussion on this page: MSAL Production Configurations Discussion



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source