Troubleshooting

Newtonsoft dll error

In some Unity versions (including several Unity 2020 and 2021 versions), you may encounter this error:

Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform.

In this case, use the Didomi-noDll.unitypackage release file instead of Didomi.unitypackage, or manually remove the file Assets/Plugins/Didomi/IOS/Newtonsoft.Json.dll from the regular package after importing it.

Gradle 6.1.1

This is the default gradle version on Unity version 2021.3 and below.

With this version, you may encounter an error at build time:

> Cannot choose between the following variants of com.google.guava:guava:32.1.3-android:
    - androidRuntimeElements
    - jreRuntimeElements

If changing the gradle version is not possible, it is possible to fix this issue:

  • In Player settings, in Android section, activate Custom Main Gradle Template and Custom Launcher Gradle Template

  • Modify Assets/Plugins/Android/mainTemplate.gradle and Assets/Plugins/Android/launcherTemplate.gradle by adding

configurations.all {
    resolutionStrategy {
        force 'com.google.guava:guava:32.0.1-android'
    }
}

before the dependencies block.

mainTemplate.gradle
configurations.all {
    resolutionStrategy {
        force 'com.google.guava:guava:32.0.1-android'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
launcherTemplate.gradle
configurations.all {
    resolutionStrategy {
        force 'com.google.guava:guava:32.0.1-android'
    }
}

dependencies {
    implementation project(':unityLibrary')
}

Last updated