lixplor / android-Q-A

🐞 android related questions and answers
0 stars 0 forks source link

Android Studio 2.0 Gradle Error [NoClassDefFoundError: Could not initialize class xxx.xxx.xxx] #48

Closed lixplor closed 7 years ago

lixplor commented 7 years ago

Android Studio 2.0 Gradle Error [NoClassDefFoundError: Could not initialize class xxx.xxx.xxx]

lixplor commented 7 years ago

原因: 65k问题 解决: 启用multidex, 在gradle中multiDexEnabled true, 在Application基类中重写attachBaseContext()并加入MultiDex.install(this)使其最先初始化;