Flutter solve multi-dex – cannot find symbol MultiDex.install

Tiempo de lectura: < 1 minuto

We are going to learn how to solve the multi-deck problem that can appear in Flutter today.

Luna - pexels

The problem is as follows:

Error: Cannot find symbol 'MultiDex.install(this);' ^ symbol: variable MultiDex location: class FlutterMultiDexApplication 2 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

To fix this, we will do the following:

android/app/build.gradle

 multiDexEnabled true

3. Then, in the block dependencies, add:

implementation 'androidx.multidex:multidex:2.0.1'

Final result (summary of app/build.gradle):

android { ... defaultConfig { ... multiDexEnabled true } }

Let’s run again:

flutter clean flutter pub get flutter run

Leave a Comment