Execution failed for task ':app:mergeDexDebug'. Firestore | Flutter

后端 未结 6 1846
[愿得一人]
[愿得一人] 2021-01-31 08:32

Trying to use Firestore in my project. My project is a brand new one, but having problems running the app on my device without getting an error: Execution failed for tas

6条回答
  •  后悔当初
    2021-01-31 09:28

    I just met with this error, and it turns out it can be fixed easily. Of course, other answers on this are really great and it tells you how to fix it. However, I was wondering why this even happened. It turns out this comes from the minSdkVersion used. If this is set to 20 or lower, you need to configure your app for multiDex support.

       defaultConfig {
            applicationId "com.inspire.aaym"
            minSdkVersion 21
            targetSdkVersion 30
        }
    

    So, if you app is not intended to be used in Android version prior to 5.0, setting the minSdkVersion number to 21 will easily fix this issue. If not, follow the workaround to enable mutiDex support.

    Read more from the official document: https://developer.android.com/studio/build/multidex#mdex-gradle

提交回复
热议问题