Advanced setup & troubleshooting
Multidex
If your project already uses several libraries, it is possible that by adding Didomi it reaches the limit of 64K references. In this case, it is necessary to enable multidex in your project: https://developer.android.com/studio/build/multidex#groovy
Example of error that can be caused by reaching the 64K limit:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:transformClassesWithDexBuilderForRelease'.
> com.android.build.api.transform.TransformException: java.lang.IllegalArgumentException: java.lang.IllegalArgumentExceptionandroid {
defaultConfig {
multiDexEnabled = true
}
}Languages
Didomi SDK supports the following languages
Restricting the supported languages can reduce your application size.
android {
defaultConfig {
resourceConfigurations += ["en", "de", "fr", "es"]
}
}android {
defaultConfig {
resourceConfigurations += listOf("en", "de", "fr", "es")
}
}Note that the Hebrew (he) language code is rewritten as iw, Indonesian (id) as in, and Yiddish (yi) as ji (see https://developer.android.com/reference/java/util/Locale.html#legacy-language-codes for more information).
For example: to add Hebrew language to the filtered list of language, you need to use iw.
App bundles
The Didomi SDK can be configured to restrict the languages it supports. If the user device language is not in the supported languages list, and app is distributed with Android App Bundles on the play store, it is possible that texts are removed from the downloaded app. In this case, all the texts will be displayed in english, except the custom texts.
To avoid this behavior, it is possible to either
disable the splitting by language in App Bundle configuration.
dynamically retrieve missing languages from Play Store through Install Manager, as described in Android developer doc: https://developer.android.com/guide/playcore/feature-delivery/on-demand?hl=fr#lang_resources
Disable splitting by language
Get missing language through Install Manager
Zipline library
Didomi SDK uses the Zipline library (https://github.com/cashapp/zipline) to interpret local javascript code. Currently the Zipline dependency version is 1.18.0.
Since Didomi SDK version 2.36.0, it is possible to exclude this library from the dependencies,. In this case the Didomi SDK will use a WebView instance to evaluate javascript.
You can exclude Zipline in the build.gradle file, when adding the Didomi dependency:
At the moment, Didomi uses javascript for the following features:
Didomi Consent String
GPP
GCM privacy signals
Drawbacks
Excluding Zipline reduces the size of the Didomi SDK, however javascript operations will be less performant.
To support the Didomi javascript features, the device WebView version must be ≥ version 61.
Other uses of WebView from a different process in the same app can result in a crash. This can happen when a WebView is used in a Service or when using specific libraries.
More information about this crash and possible solutions can be found here: https://stackoverflow.com/a/65423323.
Last updated