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

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
