Skip to main content

Frequently asked questions


Android Context has not been loaded

********************************************************************************************************
* The Android context has not been loaded by the [androidx.startup.Initializer] plugin. *
* If you encounter this error, please let us know through support so that we can improve the product. *
* To resolve this error, call the [AppConsentSDK.loadContext] method. *
********************************************************************************************************

If this error appears in your logs, follow the instruction recommended by the message by calling the following method :

AppConsentSDK.loadContext

Once you've done this, call the AppConsentSDK.initialize method again, as you did initially.

RuntimeException caused by WebView

Caused by: java.lang.RuntimeException:
Using WebView from more than one process at once with the same data directory is not supported.
https://crbug.com/558377 : Current process xx.xxx.xxxx (pid aaaaa), lock owner\"yy.yyy.yyyy (pid bbbbb)

First of all, look for the cause. It may be that this happens when you integrate our SDK (we use the WebView component), but the problem arises because the component is used by different memory areas (thread, process).

Multiple instances cannot access the same files / folders stored on the device from different Threads (concurrency).

The SDK manages this problem, but it may not be able to correct it if, for example, a third-party library uses the WebView component before the SDK has even initialized.

In which case, you'll have to manage this part yourself by defining a new directory for your WebView (https://crbug.com/558377) using this method:

WebView.setDataDirectorySuffix(String)

Duplicate classes

When compiling your project, you encounter an error from the kotlin.stdlib library explaining that you have a duplicate class ?

Caused by: java.lang.RuntimeException: Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.20-dev-78 (org.jetbrains.kotlin:kotlin-stdlib:1.8.20-dev-78) and kotlin-stdlib-jdk8-1.5.30 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.30)

Add this configuration block to your app module build.gradle:

dependencies {
...
modules {
module("org.jetbrains.kotlin:kotlin-stdlib-jdk7") {
replacedBy("org.jetbrains.kotlin:kotlin-stdlib", "kotlin-stdlib-jdk7 is now part of kotlin-stdlib")
}
module("org.jetbrains.kotlin:kotlin-stdlib-jdk8") {
replacedBy("org.jetbrains.kotlin:kotlin-stdlib", "kotlin-stdlib-jdk8 is now part of kotlin-stdlib")
}
}
...
}

Decompilation error

If you are using a version of gradle prior to version 8, you may encounter the following error when integrating CMP (since version 4.X.X):

Error: com.android.tools.r8.internal.nc: Sealed classes are not supported as program classes

This is a "normal" error, as Gradle 7 is unable to decompile certain classes (Gradle 8 requires you to migrate to JAVA 17).

The only solution is to add the R8 plugin to your project.

The reference for this patch comes from a Google Issue and the solution is as follows:

pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw")
}
}
dependencies {
classpath("com.android.tools:r8:8.2.20-dev")

}
}
}