gradle - Android Dex Optimization and Method Count -


i have android project many library projects added module.

and number of methods in project exceeds limit of android (65k). use multidex solution. didn't solve problem.

and build.gradle file.

android { compilesdkversion 23 buildtoolsversion "23.0.1" aaptoptions {     cruncherenabled = false } defaultconfig {     minsdkversion 14     targetsdkversion 23     multidexenabled = true }} 

first, tried add multidex.install() oncreate method in applicationcontext file. , didn't work. , applicationcontextnormal.java file here;

public class applicationcontextnormal extends applicationcontext {  @override public void oncreate() {     multidex.install(this);     super.oncreate(); }  } 

then, tried add multidex.install() attachbasecontext method.

public class applicationcontextnormal extends applicationcontext { ...    @override     protected void attachbasecontext(context base) {         super.attachbasecontext(base);         multidex.install(base); }     ... 

and here androidmanifest.xml;

<application     android:name="com.alyt.lytmobilenormal.connection.applicationcontextnormal"  ... 

is true should solve problem dex optimization way? made changes in main project, not in module projects. or missing something?

any idea?

from documentation

change this: add multidexenabled true lose '='

   defaultconfig {     minsdkversion 14     targetsdkversion 23     multidexenabled true } 

also class should extend application class

public class applicationcontextnormal extends application {} 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -