Production app crashes with Unhandled JS Exception: Error: INVALID_STATE_ERR

I see crashes on my production app logs
Unhandled JS Exception: Error: INVALID_STATE_ERR

Any ideas why this could happen?

Hello @dimaportenko,

Are you using CometChat iOS SDK or CometChat Hybrid (React Native/Ionic) SDK? Also, can you please let us know the version of the SDK you are using?

Warm Regards,

CometChat Pro
Mayur Bhandari

@mayur.bhandari

"@cometchat-pro/react-native-calls": "1.0.7",
"@cometchat-pro/react-native-chat": "2.2.0",

Hello @diadempro,

Can you provide us with more details on when this error occurs? Also are you able to reproduce those errors on your end?

We have added a lot of optimizations in our latest release. Can you please update both these packages to the latest version and check on your end if you are still facing this issue or not.

"@cometchat-pro/react-native-calls": "2.0.2-beta1",
"@cometchat-pro/react-native-chat": "2.3.1-beta1",

Warm Regards,

CometChat Pro
Mayur Bhandari

This is a report from our QA engineer

OS: iOS/Android

App Version: Production

Reproducibility: This is difficult to reproduce but does happen frequently

Steps to Reproduce:

  1. Open the app
  2. background the app
  3. lock your device
  4. open the device and tap on the app

@mayur.bhandari
We are going to release new version this week, do you think it’s safe to upgrade to those versions?

I have following errors after version upgrade on Android build

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeReleaseAssets'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not find com.cometchat:pro-android-calls-sdk:2.0.2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/cometchat/pro-android-calls-sdk/2.0.2/pro-android-calls-sdk-2.0.2.pom
       - https://jcenter.bintray.com/com/cometchat/pro-android-calls-sdk/2.0.2/pro-android-calls-sdk-2.0.2.pom
       - https://www.jitpack.io/com/cometchat/pro-android-calls-sdk/2.0.2/pro-android-calls-sdk-2.0.2.pom
       - https://dl.bintray.com/cometchat/pro/com/cometchat/pro-android-calls-sdk/2.0.2/pro-android-calls-sdk-2.0.2.pom
     Required by:
         project :app > project :cometchat-pro_react-native-calls

Solved with

allprojects {
  repositories {
    // For version 2.3.1 and above
        maven {
            url "https://dl.cloudsmith.io/public/cometchat/cometchat-pro-android/maven/"
    }
        
    // For versions below 2.3.1
    maven {
      url "https://dl.bintray.com/cometchat/pro"
    }
  }
}

It’s missed in the RN docs.

Hello @dimaportenko,

Can you please replace the maven URL in the build gradle file from,

maven { url "https://dl.bintray.com/cometchat/pro" }

to

maven { url "https://dl.cloudsmith.io/public/cometchat/cometchat-pro-android/maven/" }

After replacing this, please clean the build & run the project again.

Warm Regards,

CometChat Pro,
Mayur Bhandari