secondary-dex-gradle

Additional

Language
Java
Version
N/A
Created
May 18, 2014
Updated
Aug 17, 2020
Owner
Mohit Kanwal (creativepsyco)
Contributors
BtM (BtM909)
Mohit Kanwal (creativepsyco)
Santiago Castro (bryant1410)
microhuman
4
Activity
Badge
Generate
Download
Source code
APK file

Advertising

We modify the build.gradle files to be able to churn out the Dex file for the secondary library.

Take a look at app's build.gradle and lib's build.gradle.

We then use this and copy it into the assets folder which gets packaged into the final APK.

Once this is done, loading the dex at runtime is easy, and is explained in the blogpost.

A requirement is that both the library and the app will need to maintain a shared interface, otherwise the loading function will need to invoke methods at runtime via reflection.