Unable to merge dex after adding dependencies

前端 未结 2 514
故里飘歌
故里飘歌 2021-01-29 00:38

I am getting the error:

Error:Execution failed for task \':app:transformDexArchiveWithExternalLibsDexMergerForPaidFreeDebug\'. java.lang.RuntimeExcepti

2条回答
  •  悲&欢浪女
    2021-01-29 01:27

    Add this to your application class..

       @Override
       protected void attachBaseContext(Context base) {
          super.attachBaseContext(LocaleHelper.onAttach(base, "hi"));
          MultiDex.install(this);
     }
    

    like :-

    also extend the MultiDexApplication by your Application class

    public class MyApplication  extends MultiDexApplication {
    
    
    
          @Override
          protected void attachBaseContext(Context base) {
               super.attachBaseContext(base);
               MultiDex.install(this);
    }
    
    
         @Override
         public void onConfigurationChanged(Configuration newConfig) {
              super.onConfigurationChanged(newConfig);
    
         }
    
    
    }
    

    Edit:- As you are using targetSdkVersion <=23 you need to install it manually.,. and dont forget to add android:name="android.support.multidex.MultiDexApplication" to your application tag in the manifest.xml.. like this :-

    
            ...
        

提交回复
热议问题