Troubleshooting

Here are some of the errors that you may encounter in the various stages of setting up Hengam SDK in React Native, along with the solution.

These errors fall into two categories:

  1. Errors before running the app while compiling or building

  2. Errors while running the application

If your problem is not an error, it may be mentioned in the [Questions] section.

Errors while compiling or building the app

The program remains in the state of running starting Js server command

If you are using yarn to run the program, enter yarn start command in a separate commandline to start the server correctly and then enter yarn android.

Version conflict

This error occurs if different versions of a library have been added to your project. For example, you have added a library to your project that has been added by hengam or any other library. If this is the case, Gradle may not be able to handle this and the project build will result in an error. You can do the following steps to fix this error.

  • Manually add the library (that is used in multiple versions) to dependencies yourself, and usually use the latest version.

  • Force Gradle to use a specific version of the library you added yourself (put the code above the dependencies block).

// File: build.gradle (app:module)
configurations.all {
    resolutionStrategy {
        eachDependency { DependencyResolveDetails details ->
            def libraryGroup = "{artifact}"
            def forceVersion = "{version}"
            if (details.requested.group == libraryGroup) {
                details.useVersion forceVersion
            }
        }
    }
}
// dependencies {
// ...
Replace the {artifact} with library package and replace the {version} put the version you are considering and have added yourself.

Errors while running the application

- SERVICE_UNAVAILABLE error

This error, which is printed in the logcat, is often due to a lack of Internet access. If the internet connection is okay, this error may be due to Firebase because Google Play services is missing or other things.

- Invalid token error

This error is printed in Logcat because the manifest token is not in the correct format. The correct format should be as follows. You should copy Token completely and correctly from the Hengam dashboard and place it in the manifest instead of "HENGAM_TOKEN".

   <meta-data android:name="hengam_token" android:value="HENGAM_TOKEN" />

- No Token error

This error will appear in the logcat if the meta-data tag is not included in the manifest or it is not in a correct place.

<!-- AndroidManifest.xml -->
<manifest>
    ...
    <application>
        ...
        <!-- HENGAM TAG MUST GOES HERE -->
        <meta-data android:name="hengam_token" android:value="XXXXXXXXXX" />  
    </application>
</manifest>

Can't you find the error on this page?

Search the Issues section of the Github and if you find nothing, create a new issue there.