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
inside build.gradle
. Those conflict are gone, but i got another exception (on opening the app) for the missing calligraphy library:
java.lang.NoClassDefFoundError: uk.co.chrisjenx.calligraphy.R$attr
at uk.co.chrisjenx.calligraphy.CalligraphyConfig$Builder.<init>(CalligraphyConfig.java:150)
at com.taxiyaab.android.util.ApplicationClass.onCreate(ApplicationClass.java:120)
at newapp.com.taxiyaab.taxiyaab.PassengerApplication.onCreate(PassengerApplication.java:68)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4462)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
at dalvik.system.NativeStart.main(Native Method)
My latest sdk build tools version is 22.0.1
. Has anybody faced this issue before?
If your application extends from Application then override attachBaseContext inside Application i.e
Also need to add dependency
Yes,update to multidex 1.0.2 and add Mulitidex.install(this) to the class extending application
MultiDex.install(this);
This can fix the problem.
Goodlife is here again to the rescue . Add this line to ur java file that extends application.
If you support API levels under 21, your
Application
class should extendMultiDexApplication
from the support library.If you do not have a custom
Application
class, than you should add the MultiDexApplication class to your manifest directlySee https://developer.android.com/tools/building/multidex.html
What i did was too update the compiling library in app level gradle file.
I updated it too
and it worked fine for me. Maybe this helps someone.