因此,当我尝试为Android编译我的Qt应用程序时遇到了一个奇怪的错误。我的build.gradle
实际上(此处的软件包名称除外)与此处的https://github.com/Larpon/QtFirebaseExample/blob/master/App/platforms/android/build.gradle相同。但是,当我尝试编译时,会出现一长串错误,开头是:
- 出了什么问题:任务':transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。
在8秒内无法完成21个可执行的任务:执行了8个任务,执行了13个最新的com.android.builder.dexing.DexArchiveMergerException: 合并dex归档文件:
我在此处阅读过类似的线索,这些线索建议启用multiDexEnabled = true
,我已经尝试过并且还尝试清理我的应用程序,但是它不起作用。我还尝试在implementation 'com.android.support:multidex:1.0.3'
的“ dependencies”部分中添加build.gradle
,但是没有运气。终于我也设置好了,但是什么也没做。
defaultConfig {
applicationId "packagename" // Used by Firebase auto-config (the google-services.json from Firebase console)
minSdkVersion 23
targetSdkVersion 28
//versionCode 1
//versionName "1.0"
//testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
// Enabling multidex support.
multiDexEnabled = true
}
答案 0 :(得分:0)
因此,我能够通过迁移到AndroidX来解决此问题,如此处https://developer.android.com/jetpack/androidx/migrate所述。修改必要的文件后,编译错误消失了。