Troubleshooting

SDK Integration

Duplicate class error for apache/commons/codec/language

If you get a dex error like below which indicates that the apache/commons/codec/language classes are being added to the app more than once

You can remove these classes from the Helpshift.jar in two possible ways :

command line

zip -d Helpshift.jar org/apache/commons/codec/language/**

custom ant task

<target name="clean-apache" >
  <mkdir dir="./backup"/>
  <copy file="./libs/Helpshift.jar" todir="./backup"/>
  <jar destfile="./libs/Helpshift-temp.jar">
    <zipfileset src="./libs/Helpshift.jar" excludes="org/apache/commons/codec/language/**"/>
  </jar>
  <rename src="./libs/Helpshift-temp.jar" dest="./libs/Helpshift.jar"/>
</target>
<target name="restore-helpshift" >
  <move file="./backup/Helpshift.jar" todir="./libs"/>
</target>

Once done you can run a clean & compile. As these classes are already included in your application lib; they will be compiled into the final APK build and will work fine with Helpshift.

Dex merger error

If you get a dex merger error like below, enable the jumbo mode.

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Cannot merge new index 68218 into a non-jumbo
instruction!

To enable jumbo mode in Gradle add the following to your build.gradle -

android {
    dexOptions {
        jumboMode = true
    }
}

To enable jumbo mode in Ant add the following to your project.properties -

dex.force.jumbo=true

Duplicate class error for Lcom/helpshift/BuildConfig

If you get a dex error like below,

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define
Lcom/helpshift/BuildConfig;

This indicates that two BuildConfig files are getting added to the App, once via the Helpshift.jar file and then via the helpshift-android-sdk resources

You can resolve this by deleting the BuildConfig file which comes with the Helpshift.jar by using the following command -

zip -d Helpshift.jar com/helpshift/BuildConfig.class

InflateException: Binary XML file: Error inflating class com.helpshift.views.HSTextInputEditText

If you get a crash with the following error, check the android support library version you use:

java.lang.RuntimeException: Unable to resume activity {com.sampleimpactanalysis/com.helpshift.support.activities.ParentActivity}: android.view.InflateException:
Binary XML file line #7: Binary XML file line #35: Error inflating class com.helpshift.views.HSTextInputEditText

Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/design/widget/TextInputEditText;

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.TextInputEditText"

Helpshift SDK uses the "android.support.design.widget.TextInputEditText" class. Since this class was introduced in android support library v23.2.0, you would need to add dependencies for android support libraries equal to or higher than v23.2.0.

Push notifications

In case the app is not receiving push notifications, you can look at the following sections.

IP whitelisting

In order to receive push notifications from Helpshift, please note that that there should be no key restrictions on the key used with Helpshift. To ensure this: Click on the API key to be used with Helpshift on your Google console dashboard. Set the Key restriction option to None

Multi-process apps

In a multi-process Android app, the Application.onCreate() is called for every process. As the Helpshift SDK is initialized inside the Application.onCreate() method of the app, multi-process apps will lead to multiple instances of the SDK being initialized, which can lead to unexpected behavior. We recommend that the Helpshift SDK be initialized in the main process only. This can be done by checking the process name in which Application.onCreate() is called. You can refer to the example below for this:

Application.onCreate() {
    ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
    List<ActivityManager.RunningAppProcessInfo> infos = activityManager.getRunningAppProcesses();
    int myPid = android.os.Process.myPid();
    for (ActivityManager.RunningAppProcessInfo info : infos) {
        if (myPid == info.pid) {
        if (info.processName.equals(getApplicationInfo().packageName)) {
            // This is running in the main process of the app.
            Core.init(All.getInstance());
            try {
              Core.install(this,
                           "YOUR_API_KEY",
                           "YOUR_DOMAIN_NAME",
                           "YOUR_APP_ID",
                           installConfig);
            } catch (InstallException e) {
                Log.e(TAG, "invalid install credentials : ", e);
            }
        }
    }
}

Miscellaneous

Helpshift Logs with low priority DEBUG

02-19 20:35:49.853: D/HelpShiftDebug(7651): org.json.JSONException: No value for pr
02-19 20:35:49.853: D/HelpShiftDebug(7651): at org.json.JSONObject.get(JSONObject.java:354)
02-19 20:35:49.853: D/HelpShiftDebug(7651): at

You can safely ignore the Helpshift SDK debug logs (log priority "DEBUG" / "Log.d") that are seen in DDMS / Android Monitor. These will not cause any issues with the proper functioning of the SDK.

Helpshift Warning with low priority

03-13 16:49:52.667 30615-1447/? W/MessageQueue : Handler (com.helpshift.HSApiData$4){427f1eb8} sending message to a Handler on a dead thread

This is just a warning, and this has been handled by the helpshift SDK. You can safely ignore it. These will not cause any issues with the proper functioning of the SDK.

UI Issues

Cannot scroll FAQ list, cannot switch FAQ tabs, keyboard input not working when creating a new conversation etc.

These UI issues are caused when hardware acceleration is turned off for Helpshift's activities. To ensure that hardware acceleration is turned on, add this to your AndroidManifest.xml file.

<activity
    android:name="com.helpshift.support.activities.ParentActivity"
    android:hardwareAccelerated="true"
    android:theme="@style/Helpshift.Theme.Activity"/>

Known Issues

No. Known Issue SDK
Version
Device OS Version Occurs When & Frequency Workaround
1 Menu items for conversation screen and faq screen are shown together after device orientation changes when SDK is integrated with 23.x support library version v6.0.0 All

Frequency: Always

Use support library version 24.x and above
2 Clicking on search icon in FAQs screen causes an ANR when appcompat library version 25.1.0 is used. This happens due to unprecedented fragment lifecycle changes introduced in appcompat 25.1.0. Link here v4.7.0, v4.8.0 All

Frequency: Always

Use appcompat library version 25.0.1
3 Helphift SDK redraws layout with animations in multi-window mode when user resizes the window v4.7.0 Android v7.0

Frequency: Always

4 Issue due to storage permission invoke-revoke action v4.1.0 Android v6.0
  • Help -> Contact us -> Report conversation
  • Perform action like Revoke - invoke storage permission multiple times
  • Go to chat screen via help
  • You will notice that attach screenshot icon is not visible
  • Go back from chat screen.
  • Here you will have to press back button multiple times to go in main screen

Frequency : Rare

5 Crash due to FragmentTransaction animation on Samsung S3 v4.1.0 Samsung S3 (v4.3)

Frequency : Always

6 Chat screen goes up with keyboard while typing reply v4.1.0 Any

Frequency: Rare

7 Orientation for the Helpshift Activity launches in portrait and then switches to landscape when the calling activity is in landscape mode but the device is held in portrait mode. v4.9.0 Android v7.1.1
  • use `setScreenOrientation()` in InstallConfig to set the Helpshift screen to LANDSCAPE
  • Set orientation for app's activity to LANDSCAPE as well.
  • Now your activity is in landscape mode. Hold the device in portrait mode and call a Helpshift API like showFaqs().
  • The Helpshift SDK screen is first started in portrait mode and then switches to landscape mode, which was the requested orientation.

Frequency : Always