只需添加 android { .... dexOptions { // Prevent OutOfMemory with MultiDex during the build phase javaMaxHeapSize "4g" } } 在您的 build.gradle 文件中