Multidex issue in Unity

  • Create a new unity project now. “Test Multidex App”
  • Create a Sample scene file which contains two buttons and a sample script file. And add too many .jar and .aar files on Assets/Plugins/Android file path to get multidex issue.
  • And finally we got multidex error!
  • Actually at this point we cannot be sure that its multidex error. So to get the exact error detail, go to Console tab, click on right corner dropdown and select Open Editor Log.
  1. Export the project to Gradle
build.gradle
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26"
/>
android {
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
<application
android:name="android.support.multidex.MultiDexApplication" >
...
</application>
android {
..
..

defaultConfig {
....
}
dexOptions {
javaMaxHeapSize "4g"
}

}

--

--

--

An engineer | Poet | Thinker | https://www.linkedin.com/in/narendra-pal-mobile-engg/ | https://stackoverflow.com/users/1395259/narendra-pal

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How To Migrate A WordPress Site From Shared Hosting To A VPS Server Using Only Plugins.

How To Migrate A WordPress Site From Shared Hosting To A VPS Server Using Only Plugins.

Review Book: Clean Code

Frontend testing doesn’t have to be complicated

Multi-Language with .Net 6

Elegant Dashboards for Python ML Apps using Taipy GUI

Learn Beginner Code In Python For Testing Automation-Part 2

What Java 18 has to offer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Narendra Pal

Narendra Pal

An engineer | Poet | Thinker | https://www.linkedin.com/in/narendra-pal-mobile-engg/ | https://stackoverflow.com/users/1395259/narendra-pal

More from Medium

Introducing VLC for Unity — Android Edition

Problem: Trying to run a Flutter application with the flutter run command produces the following…

Google SignIn without Firebase for Android on Flutter