This sample project shows how to impelent android-maven-plugin multi-dex mechanism.
Procedure:
-
Flag minimal-main-dex is set to true to ensure that only classes listed in
MainDexList.txt
come in classes.dex, other classes including activities come to secondary dexes. -
Install
multidex.jar
in local m2 (or any other) repository with following maven properties
<groupId>com.android.support</groupId>
<artifactId>multidex</artifactId>
<version>20</version>
-
Import that dependency in your pom.xml
-
Extend your Application class to
MultiDexApplication
and specify that name in your AndroidManifest.xml in tag:
<application
android:name="com.sample.multidex.MultiDexApplication">
</application>
Proguard is enabled without shrinking.