Skip to main content
This guide covers common issues you may encounter when integrating or using the Kount Android SDK, along with their solutions.

Installation Issues

Problem

The SDK fails to download or resolve during Gradle sync.

Solution

  1. Verify you have the correct repository configured in your build.gradle:
repositories {
  google()
  mavenCentral()
  // Add Kount's repository if needed
}
  1. Check your SDK version exists and is correct:
dependencies {
  implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'
}
  1. Clean and rebuild your project:
./gradlew clean build

Problem

Build fails with Instant App library errors, even though you’re not building an Instant App.

Solution

You must include the Instant App library at compile time, even if you are not building an Instant App.
Add the Instant App library to your dependencies:
dependencies {
  implementation 'com.google.android.instantapps:instantapps:1.1.0'
}

Configuration Issues

Problem

Getting NullPointerException or SDK appears not to be initialized.

Solution

Ensure you initialize the SDK before calling any collection methods:
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  
  // Initialize SDK BEFORE any collection calls
  KountSDK.INSTANCE.setMerchantId("999999");
  KountSDK.INSTANCE.setEnvironment(KountSDK.ENVIRONMENT_TEST);
  
  // Now you can call collection methods
  KountSDK.INSTANCE.collectForSession(this, successHandler, failureHandler);
}

Problem

Compilation error or type mismatch when setting merchant ID in version 4.3.1+.

Solution

In version 4.3.1+, merchant ID changed from Integer to String.
Incorrect (old versions):
int merchantId = 999999;
KountSDK.INSTANCE.setMerchantId(merchantId);
Correct (4.3.1+):
String merchantId = "999999";
KountSDK.INSTANCE.setMerchantId(merchantId);

Problem

Data collection appears to work, but no data shows in Kount dashboard.

Solution

Verify you’re using the correct environment:
// For testing/development
KountSDK.INSTANCE.setEnvironment(KountSDK.ENVIRONMENT_TEST);

// For production
KountSDK.INSTANCE.setEnvironment(KountSDK.ENVIRONMENT_PRODUCTION);
Make sure your merchant ID is valid for the environment you’re using.

Permission Issues

Problem

The app doesn’t request location permission, and location data isn’t collected.

Solution

  1. Add location permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  1. Request permission at runtime for Android 6.0+ (API 23+):
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
  if (ContextCompat.checkSelfPermission(this, 
      Manifest.permission.ACCESS_FINE_LOCATION) 
      != PackageManager.PERMISSION_GRANTED) {
    
    ActivityCompat.requestPermissions(this,
      new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
      KountSDK.REQUEST_PERMISSION_LOCATION);
  }
}
  1. Handle the permission result:
@Override
public void onRequestPermissionsResult(int requestCode, 
    String[] permissions, int[] grantResults) {
  
  if (requestCode == KountSDK.REQUEST_PERMISSION_LOCATION) {
    if (grantResults.length > 0 && 
        grantResults[0] == PackageManager.PERMISSION_GRANTED) {
      // Permission granted - collect data
      KountSDK.INSTANCE.collectForSession(this, 
        successHandler, failureHandler);
    } else {
      // Permission denied - collect without location
      Log.w("Kount", "Location permission denied");
    }
  }
  super.onRequestPermissionsResult(requestCode, permissions, grantResults);
}

Problem

Data collection fails or times out.

Solution

Add internet permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />

Collection Issues

Problem

The completion handlers are never called, or collection times out.

Solution

  1. Check internet connectivity: Ensure the device has an active internet connection.
  2. Verify permissions: Make sure INTERNET permission is in your manifest.
  3. Check SDK version: Versions 4.2.0 and 4.2.1 had a race condition. Upgrade to 4.2.2+:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'
  1. Single Page Applications: If you’re running a SPA or don’t transition to a second view, make sure you’re on version 4.1.3+ which fixed data transmission delays.
  2. Check collection status:
String status = KountSDK.INSTANCE.getCollectionStatus();
Log.d("Kount", "Collection status: " + status);

Problem

The session ID returned is null or empty.

Solution

Version 4.3.1+: The SDK automatically generates a session ID if one is not provided.
// SDK will auto-generate session ID
KountSDK.INSTANCE.collectForSession(
  this,
  sessionId -> {
    // sessionId will be auto-generated if needed
    Log.d("Kount", "Session ID: " + sessionId);
    return null;
  },
  (sessionId, error) -> {
    Log.e("Kount", "Error: " + error);
    return null;
  }
);
Older versions: You may need to provide your own session ID:
String customSessionId = UUID.randomUUID().toString();
// Pass to collection method

Problem

The failure handler is called immediately when starting collection.

Solution

  1. Check initialization: Ensure SDK is properly initialized before collection.
  2. Verify merchant ID: Make sure your merchant ID is valid:
String merchantId = "999999"; // Use your actual merchant ID
KountSDK.INSTANCE.setMerchantId(merchantId);
  1. Check error message: Log the error in your failure handler:
(sessionId, error) -> {
  Log.e("Kount", "Collection failed: " + error + ", SessionID: " + sessionId);
  return null;
}
  1. Context issues: Ensure you’re passing a valid Activity context, not Application context.

Problem

Collection completes but data doesn’t transmit to Kount servers immediately.

Solution

If using version 4.1.2 or older: Upgrade to version 4.1.3+ which fixes transmission delays:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'
This issue particularly affected:
  • Single Page Applications (SPAs)
  • Apps with Analytics enabled
  • Apps that don’t transition to a second view before requesting data

Analytics Issues

Problem

App experiences memory leaks when Analytics is disabled and many Activities are created.

Solution

Upgrade to version 4.2.4+ which fixes this memory leak:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'
If you can’t upgrade, ensure Analytics is enabled:
KountSDK.INSTANCE.setCollectAnalytics(true);

Problem

Analytics feature (UI element collection) doesn’t seem to work.

Solution

  1. Check SDK version: UI element collection was added in 4.1.0.
  2. Enable Analytics:
KountSDK.INSTANCE.setCollectAnalytics(true);
  1. Check Android version: Some features require Android 10+ (API 29) for full functionality.
Analytics collection defaults to true in version 4.1.0+.

Version-Specific Issues

Problem

Security scan reports CWE-926 vulnerability.

Solution

Upgrade to version 4.3.2 or later which patches this vulnerability:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'

Problem

App crashes with NullPointerException when charging cable is connected or disconnected.

Solution

Upgrade to version 4.1.2+ which fixes this issue:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'

Problem

Collections don’t start if the user doesn’t switch Activities.

Solution

Upgrade to version 4.2.1+ which fixes this timing issue:
implementation 'com.kount.mobile:kount-mobile-sdk:4.3.2'

Debugging Tips

1

Enable Logging

Add logging to track SDK behavior:
Log.d("Kount", "Merchant ID: " + merchantId);
Log.d("Kount", "Environment: " + environment);
Log.d("Kount", "Collection status: " + KountSDK.INSTANCE.getCollectionStatus());
2

Check Collection Status

Monitor the collection status throughout the lifecycle:
String status = KountSDK.INSTANCE.getCollectionStatus();
Log.d("Kount", "Current status: " + status);
3

Test on Multiple Devices

Test on different Android versions:
  • Minimum supported version (API 26 for latest SDK)
  • Android 10+ for full features
  • Different manufacturers (Samsung, Google, etc.)
4

Review Logcat Output

Filter logcat for Kount-related messages:
adb logcat | grep -i kount

Still Having Issues?

If you’re still experiencing problems:
  1. Review the Migration Guide if you recently upgraded
  2. Check the Changelog for version-specific issues
  3. Visit Kount Community
  4. Email [email protected] with:
    • SDK version
    • Android version and device model
    • Relevant code snippets
    • Logcat output showing the issue

Build docs developers (and LLMs) love