1. 程式人生 > >android studio編譯錯誤

android studio編譯錯誤

Cannot fit requested classes in a single dex file. Try supplying a main-dex list.

methods: 67363 > 65536

Message{kind=ERROR, text=Cannot fit requested classes in a single dex file. Try supplying a main-dex list.

methods: 67363 > 65536, sources=[Unknown source file], tool name=Optional.of(D8)}

大致意思

你現在算上導包方法一共有67363個android有個限制不能大於65536個方法

解決辦法

在app.gradle的config中加入這行屬性

multiDexEnabled true