---
source_url: https://www.pubnub.com/docs/sdks/kotlin/troubleshoot
title: Troubleshooting for Kotlin SDK
updated_at: 2026-06-04T11:12:10.932Z
sdk_name: PubNub Kotlin SDK
sdk_version: 13.4.0
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Troubleshooting for Kotlin SDK

PubNub Kotlin SDK, use the latest version: 13.4.0

Install:

```bash
Add PubNub dependency to your build@13.4.0
```

Understand what to do when you encounter the most common issues.

## Android crashes with org.json classes

If your Android release build crashes immediately on startup with errors related to `org.json` classes (for example, `java.lang.NoSuchMethodError: No virtual method e()Ljava/lang/Object; in class Lorg/json/JSONTokener;`), this might be caused by ProGuard or R8 configuration of your project.

### Root cause

The PubNub Kotlin SDK introduces a transitive dependency on `org.json` classes that are built into the Android platform. When ProGuard or R8 shrinks your release build, it may rename `org.json` methods (for example, `nextValue()` → `e()`). At runtime, however, Android loads its own original version of `org.json` from the framework — causing `NoSuchMethodError` crashes because the renamed method names no longer exist.

### Fix

Add this rule to your ProGuard configuration file (`proguard-rules.pro`) to prevent renaming of `org.json` classes:

```bash
# Prevent renaming of org.json classes (required for Android)
-keepnames class org.json.** {
    *;
}
```

## Android crashes on older API versions

If your app crashes on Android API levels below 26 with `java.time` related errors, you need to enable Java 8 API desugaring.

### Root cause

The Kotlin SDK uses `java.time` package features that were added in Android API 26. Apps with `minSdkVersion` below 26 don't have access to these APIs by default.

### Fix

Enable Java 8 API desugaring in your app-level `build.gradle`:

```gradle
android {
    compileOptions {
        // Flag to enable support for the new language APIs
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
}
```

For more information, refer to [Android's Java 8+ API desugaring documentation](https://developer.android.com/studio/write/java8-support#library-desugaring).