Android dependency management

From monolithic to modular

The Defold engine has up until a few months ago been fairly monolithic with Facebook, In-App Purchases, Push, Advertising Id and other things all included in the engine bundle on mobile. With native extension and our recent efforts to move non-core parts of the engine into extensions this has changed.

The good

The change is mostly for the better with users being able to pick and chose what to include and thus being in control of the size of the engine, as well as which functionality to provide and which permissions that are needed.

The bad

There is however one very obvious problem: Android dependency management. On Android there is an entire ecosystem of hosted dependencies in online repositories with tools to manage them and resolve version conflicts.

With more and more Defold native extensions supporting Android SDKs and features of the Android OS it has been up to the extension developers to include the correct dependencies while at the same time ensuring that the dependencies doesn’t conflict with dependencies of other extensions. We have provided several base extensions containing commonly used libraries, but the whole process of building and maintaining these has not been straight forward.

The quick fix

We have decided to collect all base extensions into a single repository to make it easier to use, update and share them. The base extensions are available here:

The existing official Defold extensions have all been updated with new required dependencies from the android-base-extensions repo. The extensions with new releases and required dependencies are:

The real fix

Collecting all base extensions to bring some order to the shared libraries is not a long term fix though. The real fix to the problem is to start supporting Gradle dependency resolution on the build server and let extensions define Gradle dependencies that gets resolved when then engine is built. We will start adding this support in the coming weeks and we’ll share progress with you when we know more about how it will work.

18 Likes