Unity Gradle Errors

This needs Multi Dex to be enabled. Follow the below steps to enable multi dex.

  1. Open File -> Build Settings -> Player Settings -> (Android Tab) -> Publishing Settings

  2. Enable Custom Gradle Template under Build section

  3. The above step creates mainTemplate.gradle file under Assets/Plugins/Android folder

  4. Open mainTemplate.gradle file

  5. Add implementation 'com.android.support:multidex:1.0.1' under root dependencies section (right under *DEPS* entry)

  6. Add multiDexEnabled true under defaultConfig section

  7. Lastly, add android:name="android.support.multidex.MultiDexApplication" as an attribute to application tag in your root manifest file (location : Assets/Plugins/Android/AndroidManifest.xml). If there is no file, create default one from manifest template.



<application android:name="android.support.multidex.MultiDexApplication" ...>