> For the complete documentation index, see [llms.txt](https://cmp.docs.sirdata.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cmp.docs.sirdata.net/en/mobile-apps-native-sdk/mobile-sdk/troubleshooting.md).

# Troubleshooting

| Symptom                                                                                                                                                                                | Cause and fix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Android: `Could not find com.sirdata.cmp:android-sdk`                                                                                                                                  | `mavenCentral()` is missing from your repositories, or the version does not exist yet — check [Versions](/en/mobile-apps-native-sdk/mobile-sdk/versions.md).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Android: `Could not find androidx.compose:compose-bom:2024.02.00`, or another `androidx` artifact                                                                                      | `google()` is missing from your repositories: the SDK's AndroidX and Compose dependencies are only on Google's Maven repository. Declare both `google()` and `mavenCentral()` — see [Setup — Android](/en/mobile-apps-native-sdk/mobile-sdk/setup.md).                                                                                                                                                                                                                                                                                                                                                                                                               |
| iOS build: `value of type 'X' has no member '<api>'`                                                                                                                                   | The Swift UI layer and the binary framework are at different versions. Resolve the package again, and make sure you are not mixing a local checkout with a released version.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| The banner re-appears on every launch                                                                                                                                                  | Your app is deciding for itself. Use `awaitConsentDisplayDecision()` — a partial consent must re-open the banner and a capping window must suppress it, neither of which is visible from the TC string. If the decision's workflow is `COOKIEWALL`, this is expected: with the cookie wall enabled, the consent UI returns at every launch until the user grants purpose 1.                                                                                                                                                                                                                                                                                          |
| The banner never appears                                                                                                                                                               | Read `decision.reason` (see [Logging](/en/mobile-apps-native-sdk/mobile-sdk/logging.md)). An active capping window, a complete stored consent, or GDPR not applying are all normal.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| A vendor SDK reports no consent                                                                                                                                                        | Initialization order. The CMP must be initialized — and consent collected — before the vendor SDK reads storage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Storage holds `IABTCF_PublisherConsent`, or the GPP keys, before the user has made any choice                                                                                          | Expected. Once the configuration has loaded, the SDK writes the keys that do not wait for a choice: `IABTCF_gdprApplies`, `IABTCF_PolicyVersion`, `IABTCF_PublisherCC`, `IABTCF_PurposeOneTreatment`, `IABTCF_UseNonStandardTexts`, the publisher bit strings, holding the SDK's defaults, and, for a US user, the GPP keys with the US National section. A recorded choice is what writes `IABTCF_TCString`: test that key. See [Sharing consent with vendor SDKs](/en/mobile-apps-native-sdk/mobile-sdk/sharing-consent.md#the-keys-the-sdk-maintains).                                                                                                            |
| Code you re-run on `getConsentUpdates()` misses a US opt-out                                                                                                                           | A US choice — saved on the US screen, or recorded with `setCcpaOptOut` — does not change the counter in 2.0.0. Re-read `getUspString()` and `getGppString()` when the consent UI closes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `isGdprApplies()` returns the wrong value at startup                                                                                                                                   | Before the publisher configuration lands, applicability is inferred from device geo. Await the configuration. `gdprDefaultApplies` is the answer only when the device reports no country: set it to the assumption that is safe for you.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Consent from another publisher appears in the app                                                                                                                                      | The partner / config pair changed without clearing consent. A TC string belongs to the publisher that collected it; clear stored consent when switching pairs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| SwiftUI availability error (`only available in iOS 16.0 or newer`)                                                                                                                     | The SDK's sources never use an API newer than their minimum, so an error pointing at an SDK file means an outdated SDK version: update to the latest one rather than raising your deployment target to 16. Your deployment target must be **at least iOS 15.0**, whatever the channel (only the SPM package 1.2.0 declared iOS 14.0).                                                                                                                                                                                                                                                                                                                                |
| iOS: the consent UI shows only a loading indicator, and the user cannot close it                                                                                                       | Known issue in 2.0.0. When the configuration could not be loaded at this launch — no network, or wrong IDs — the consent UI shows only a loading indicator, with no close control. A `.sheet` can still be swiped down, but not with `.interactiveDismissDisabled()`, nor a full-screen presentation (UIKit `.overFullScreen`, React Native `showConsentUI()`). Present the UI in a `.sheet` the user can swipe down. `IosCMPApi.shared.getInitError()` tells whether the configuration failed to load — see [Logging](/en/mobile-apps-native-sdk/mobile-sdk/logging.md). Fixed in the next release (unreleased): the consent UI shows a message and a Close button. |
| iOS: the app terminates at launch or on its first SDK call, with `SirDataCMP is already initialized. Call shutdown() first.` or `SirDataCMP not initialized. Call initialize() first.` | Kotlin exceptions are not converted to Swift errors, so these misuses terminate the app. Call `IosCMPApi.shared.initialize` exactly once, on the main thread — in `App.init()` or `application(_:didFinishLaunchingWithOptions:)` — before any other SDK call and before creating a `ConsentView`. The calls that need it are listed in [Reference — iOS](/en/mobile-apps-native-sdk/mobile-sdk/reference-1.md). Fixed in the next release (unreleased): these calls no longer terminate the app.                                                                                                                                                                    |
| CocoaPods: `pod install` fails with "required a higher minimum deployment target"                                                                                                      | The `SirdataCMP` pod, and the React Native module's pod that depends on it, require iOS 15.0. Set `platform :ios, '15.0'` (or higher) in your `Podfile`, then run `pod install` again.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Swift Package Manager stays on 1.2.0 after updating packages                                                                                                                           | A rule "Up to Next Major Version" from 1.2.0 never resolves 2.0.0, because a new major version is outside it. Change the rule to start from 2.0.0 — in Xcode, in the project's Package Dependencies; in `Package.swift`, `from: "2.0.0"` — and set your deployment target to at least iOS 15.0.                                                                                                                                                                                                                                                                                                                                                                      |
| Android release build (R8): `Missing class org.slf4j.impl.StaticLoggerBinder`                                                                                                          | Version 1.2.0 shipped no R8 rules. Update to 2.0.0, which carries its own rules, including this one and those the consent adapters need, then remove the rules you added for the SDK. With 1.2.0, `-dontwarn org.slf4j.impl.StaticLoggerBinder` lets the build pass, but the Firebase Analytics adapter then sends nothing in a minified build.                                                                                                                                                                                                                                                                                                                      |
| React Native: `The package '@sirdata/react-native-cmp' doesn't seem to be linked`                                                                                                      | The module's native code is not in the app: it runs in Expo Go, which cannot load custom native code, or it was not rebuilt after installing the package. Use an Expo development build (`npx expo run:ios`, `npx expo run:android`) or a bare React Native app; run `pod install` in `ios/`, then rebuild. See [Setup — React Native](/en/mobile-apps-native-sdk/mobile-sdk/react-native-setup.md).                                                                                                                                                                                                                                                                 |
| React Native on Android: `initialize` rejects with `E_INIT` and `SirDataCMP.initialize() was called off the main thread`                                                               | In 2.0.0 to 2.0.2 the Android bridge calls `initialize` off the main thread, and `debugMode: true` turns that into an error. Do not pass `debugMode: true` on Android. Without it, the SDK only logs the same line on the `SirDataCMP` Logcat tag. See [Setup — React Native](/en/mobile-apps-native-sdk/mobile-sdk/react-native-setup.md).                                                                                                                                                                                                                                                                                                                          |
| React Native on iOS: the app terminates on `shouldCollectConsent()`, `acceptAll()` or `rejectAll()`, even after `initialize()` has resolved                                            | A defect of version 2.0.0 of the package: React Native calls these methods off the main thread, where the native SDK cannot run them. Upgrade to 2.0.2, then rebuild the iOS app. See [Setup — React Native](/en/mobile-apps-native-sdk/mobile-sdk/react-native-setup.md).                                                                                                                                                                                                                                                                                                                                                                                           |
| React Native: from a settings entry, "Continue without accepting" leaves an earlier "Accept all" recorded                                                                              | In 2.0.0 and 2.0.1, `showConsentUI()` reopens the first-visit banner, whose refusal button withdraws a stored choice only when the configuration's refusal option is "Reject all and close". Upgrade to 2.0.2: once a choice is stored, `showConsentUI()` opens the reopen mode, which shows "Reject all". With 2.0.0 or 2.0.1, offer an entry that calls `rejectAll()`, or point users to **Customize my choices**, then **Reject all**. See [Setup — React Native](/en/mobile-apps-native-sdk/mobile-sdk/react-native-setup.md).                                                                                                                                   |

## Getting help

Include, in this order: SDK version and platform, your partner ID and config ID, what `decision.reason` returned, and whether `IABTCF_CmpSdkID` is present in storage. Those four answers resolve most cases without a round trip.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cmp.docs.sirdata.net/en/mobile-apps-native-sdk/mobile-sdk/troubleshooting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
