Fixing ` Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K.` in Flutter when using Firestore

I created a new project, integrated Firestore to it, and on the first run, I got this error.

A quick search got me to The error also shares this link:

The relevant section is "Configure your app for multidex" ( Step 1 instructs to modify build.gradle. Step 2 instructs to modify the manifest. Doing Step 1 was sufficient in my case.