Error handling 为颤振添加多指标支持

Error handling 为颤振添加多指标支持,error-handling,flutter,android-multidex,Error Handling,Flutter,Android Multidex,我正在用Flutter构建我的应用程序。现在我总是遇到这样的错误: FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug',> com.android.builder.dexing.DexArchiveMergerException: Error while m

我正在用Flutter构建我的应用程序。现在我总是遇到这样的错误:

FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug',> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...The number of method references in a .dex file cannot exceed 64K.Learn how to resolve this issue: https://developer.android.com/tools/building/multidex.html* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.* Get more help at https://help.gradle.org BUILD FAILED in 32s Finished with error: Gradle build failed: 1

所以这个错误清楚地表明我必须添加多索引支持。但是如何在flatter中做到这一点呢?

最后,我通过删除CloudFirestore实现解决了这个问题。当时似乎存在版本错误。

问题不在于Firebase或Firestore-问题在于您添加到应用程序中的依赖项的数量,您需要启用Multidex-有一些步骤说明如何在线执行此操作Android 5.0之前的平台版本使用Dalvik运行时执行应用程序代码。默认情况下,Dalvik将应用程序限制为每个APK的单个classes.dex字节码文件。为了克服此限制,您可以将multidex支持库添加到项目中:

依赖关系{ def multidex_version=“2.0.1” 实现“androidx.multidex:multidex:$multidex\u version” }

要查看此库的当前版本,请参阅“版本”页面上有关Multidex的信息

如果未使用AndroidX,请添加以下支持库依赖项:

依赖项{implementation'com.android.support:multidex:1.0.3'}

检查