# 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:

```log
> 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`

<figure><img src="https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-76f64c536a2062f9781a4a02e5b9519349dc1213%2FCapture%20d%E2%80%99e%CC%81cran%202023-10-23%20a%CC%80%2015.59.12.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1703900661-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDh8ZWDZrXs8sc4QKEQ%2Fuploads%2Fgit-blob-974b898a265835b35f5dbc3881cfa261c31fa89e%2FCapture%20d%E2%80%99e%CC%81cran%202023-10-23%20a%CC%80%2016.46.44.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

before the `dependencies` block.

{% code title="mainTemplate.gradle" %}

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
```

{% endcode %}

{% code title="launcherTemplate.gradle" %}

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

dependencies {
    implementation project(':unityLibrary')
}
```

{% endcode %}
