For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

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.

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). 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.

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. 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. 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.

React Native on Android: initialize rejects with E_INIT and SirDataCMP.initialize() was called off the main thread

In 2.0.0 and 2.0.1 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.

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.1, then rebuild the iOS app. See Setup — React Native.

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.

Mis à jour

Ce contenu vous a-t-il été utile ?