Calligraphy: NoClassDefFoundError while loading my activity

Awesome library, makes custom fonts a breathe. Work fine on my testing device (Nexus 5 running M) but crashed with the following stack trace on a Samsung (no surprise there) device (GT S7272 running 4.2.2) Any ideas?

Fatal Exception: java.lang.NoClassDefFoundError: uk.co.chrisjenx.calligraphy.R$attr
       at uk.co.chrisjenx.calligraphy.CalligraphyConfig$Builder.<init>(CalligraphyConfig.java:150)
       at net.sarmady.contactcarswithtabs.ContactCarsApplication.onCreate(ContactCarsApplication.java:145)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4552)
       at android.app.ActivityThread.access$1400(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1340)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5279)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
       at dalvik.system.NativeStart.main(NativeStart.java)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 31 (16 by maintainers)

Most upvoted comments

Checked… 1) Not using Android studio 2.0 so no instant run 2) Multidex 1.0.1 is in use 3) Calling Multidex.init() in attachBaseContext method of Application class & Calligraphy config calling in onCreate of Application class. I am facing this issue only on 4.0

Happens to me a bit randomly on a Samsung (Galaxy Nexus) Device running 4.2.1.

I’m using MultiDex. I have two flavors. One that is minSdkVersion 21 and another minSdkVersion 15.

When I develop on my Nexus 5 I use the first one for faster multidex build. Sometimes, I give a go at the Galaxy Nexus to check whether everything still works fine on it. So I switch to the second flavor. I usually do a clean project and launch the app.

The app crashes on start on the Galaxy Nexus with java.lang.NoClassDefFoundError: uk.co.chrisjenx.calligraphy.CalligraphyConfig$Builder

If I try to launch the app multiple times, it randomly works after multiple try.