---
source_url: https://www.pubnub.com/docs/sdks/kotlin/faq
title: FAQ for Kotlin SDK
updated_at: 2026-05-22T09:16:01.000Z
sdk_name: PubNub Kotlin SDK
sdk_version: 13.4.4
---

# FAQ for Kotlin SDK

PubNub Kotlin SDK, use the latest version: 13.4.4

Install:

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

> For AI agents: documentation index at https://www.pubnub.com/llms-full.txt

## Why are there two subscribe methods?

The Kotlin SDK supports a modern, entity-based flow and retains a legacy `subscribe()` for backward compatibility.

Use the modern flow documented in [Subscribe](https://www.pubnub.com/docs/sdks/kotlin/api-reference/publish-and-subscribe.md#subscribe). It creates a `Subscription` or a `SubscriptionSet`, uses an event listener, and can resume from a timetoken with `SubscriptionCursor`. The legacy builder `pubnub.subscribe(...)` is documented in [Subscribe (old)](https://www.pubnub.com/docs/sdks/kotlin/api-reference/publish-and-subscribe.md#subscribe-old) and remains for existing applications.

## Why does my Android release build crash on startup but my debug build works fine?

Release builds enable ProGuard or R8 code shrinking by default, which debug builds typically skip. The PubNub Kotlin SDK has a transitive dependency on `org.json` — a library that is also bundled with the Android framework. When R8/ProGuard shrinks your APK, it renames `org.json` methods (for example, `nextValue()` → `e()`), but at runtime Android loads its own original version from the framework, causing a `NoSuchMethodError` crash.

The fix is to add a `-keepnames` rule for `org.json` in your ProGuard configuration. See [Android crashes with org.json classes](https://www.pubnub.com/docs/sdks/kotlin/troubleshoot.md#android-crashes-with-orgjson-classes) for the full details and rule.

## Why does encryption use AES-128 when cryptoModule is configured?

If a call supplies a `cipherKey` (for `encrypt`/`decrypt` or stream helpers), that argument overrides the configured `cryptoModule` for that operation and uses legacy Advanced Encryption Standard (AES) with 128-bit keys. Remove the `cipherKey` argument to use the `cryptoModule` configuration (AES‑256‑CBC), or configure a separate `cryptoModule` instance for partial encryption scenarios.

For details, refer to [CryptoModule configuration](https://www.pubnub.com/docs/sdks/kotlin/api-reference/configuration.md#cryptomodule).

Last updated at: 2026-05-22T09:16:01.000Z
