Announcing Multidex Support for Android Builds in Corona SDK

Announcing Multidex Support for Android Builds in Corona SDK

With the recent wave of new plugins, some Corona developers have reported Android build failures with errors like this:

This error happens due to a design limitation in the Android platform where the file containing the compiled Android code is limited to 65k symbols. More information on this limitation can be found here.

Today, we are pleased to announce that Corona SDK projects built for Android are no longer subject to this limit, thanks to Multidex support!

What is Multidex support?

Multidex support allows the Android build system to generate multiple files containing Android bytecode and be able to load symbols between the two dynamically. These Android bytecode files are known as DEX files and as previously mentioned, each one has a hard limit of 65k symbols.

How do I take advantage of multidex in Corona SDK?

The only thing you’ll need to do to take advantage of multidex support is upgrade to daily build 2016.2853 or later. After that, you don’t have to do anything to perform a multidex build for Android. Just do an Android build as you normally would and our build system will take care of the rest for you.

How does Corona address known multdex limitations?

The multidex system isn’t perfect for older versions of Android and there are known limitations. We’ve done our best to ensure Corona-made apps aren’t hindered by these limitations.

That said, we still advise you test your project on older versions of Android (2.3.3 – 4.0). If your project does run into any of the limitations listed in the link above, you may have to change the minSdkVersion of your project to API Level 14 (Android 4.0). You can do this by adding the following to your build.settings:

Impact on Android Builds through Corona SDK.

Generating Android apps that utilize multiple DEX files isn’t a cheap process. You may see a slight increase in build times because of this.

Reporting Issues

Should you encounter any issues with this, please let us know by filing a bug report. Please remember that a bug report should contain the minimal amount of code (main.lua) to show the problem, along with config.lua and build.settings. If your project requires any artwork or sound, make sure they are also included in the submitted project.

Feel free to discuss this in our Forums.

Tags:
,
ajay
3 Comments
  • Tony
    Posted at 17:27h, 31 March

    great work thank you,
    is this available for Enterprise as well?

    • Alexander McCaleb
      Posted at 13:53h, 25 May

      Hi Tony,
      This announcement is just for builds using the Simulator. For Enterprise, you can migrate your project to Android Studio and then follow Google’s instructions for multi-dex support from there.
      See our Android Studio Enterprise Announcement for more details.

  • Steve Bullock
    Posted at 12:17h, 01 April

    This is welcome news. Thanks for this improvement!