Noclassdeffounderror On Calligraphy Library
After adding compile 'com.android.support:support-v13:21.0.+' to build.gradle, I had some conflicts on building my app, so I had to add multiDexEnabled = true to defaultConfig insi
Solution 1:
If your application extends from Application then override attachBaseContext inside Application i.e
@OverrideprotectedvoidattachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Also need to add dependency
compile'com.android.support:multidex:1.0.1'
Solution 2:
Goodlife is here again to the rescue . Add this line to ur java file that extends application.
publicvoidonCreate() {
super.onCreate();
mInstance = this;
//ADD MULTIDEX.INSTALL(THIS) SOLVED MY SIMILAR PROBLEMMultiDex.install(this);
CalligraphyConfig.initDefault(newCalligraphyConfig.Builder()
.setDefaultFontPath("fonts/Roboto-Regular.ttf")
.setFontAttrId(R.attr.fontPath)
.build()
);
}
Solution 3:
Yes,update to multidex 1.0.2 and add Mulitidex.install(this) to the class extending application
Solution 4:
MultiDex.install(this);
This can fix the problem.
Solution 5:
What i did was too update the compiling library in app level gradle file.
compile'com.android.support:multidex:1.0.0'
I updated it too
compile'com.android.support:multidex:1.0.1'
and it worked fine for me. Maybe this helps someone.
Post a Comment for "Noclassdeffounderror On Calligraphy Library"