NoClassDefFoundError on Calligraphy library

后端 未结 6 724
南笙
南笙 2021-01-01 19:49

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 m

6条回答
  •  臣服心动
    2021-01-01 20:15

    Goodlife is here again to the rescue . Add this line to ur java file that extends application.

     public void onCreate() {
        super.onCreate();
    
        mInstance = this;
    
        //ADD MULTIDEX.INSTALL(THIS) SOLVED MY SIMILAR PROBLEM
        MultiDex.install(this);
        CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                        .setDefaultFontPath("fonts/Roboto-Regular.ttf")
                        .setFontAttrId(R.attr.fontPath)
                        .build()
        );
    }
    

提交回复
热议问题