Defold Bundle Android fails to produce 64 bit APK

Having worked my way through many of the excellent Defold tutorials I tried my hand at building an APK in order to install and try out on my own Android device. Like most devices these days it is a 64 bit affair. I dutifully did thefollowing

  • clicked Project - > Bundle -> Android application
  • elected to leave the cert spec empty and chose a debug build
  • unchecked the 32 bit architecture option
  • checked the Arm64 build option
  • clicked Create Bundle…

At this point things went awry. In the first instance why does it talk of creating bundles if what it in fact provides is an APK. Secondly, no matter what I do all I get back is the armv7 32 bit APK which promptly fails to install on my test device.

Another question that springs to mind here - if I have understood correctly Defold is brought to us entirely free of charge courtesy of King of Candy Crush fame. Why on earth are we being able to allowed to churn their servers to build our apps in the cloud - as far as I can tell the APK was built without using my local Android SDK/Java.

How did you recognize that you have 32 bit version? I assume that you think that because of folder name.
Even if you build 64bit version (or both at the same time) folder name is still armv7-android.

If you want to make sure, just rename your apk to zip, unpack it and check what folders you have in lib folder.

I think the reason that you can’t install apk isn’t in 32 or 64 bit. More likely it’s because of security options. I have one device that I can’t use if I use a development certificate (certificate fields are empty) but it works fine if I use my generated certificate.

Correct - I figured it was the 32 APK because of the folder name. I felt my suspicions confirmed when it failed to install. I doubt that this can be a security issue - I install debug APKs created by Flutter and Cordova on the same device very often. The device in question is an LG G7 Fit, LM-Q850EMW, running Android 9.

Just try to change default package name: game.project->Android->Package before you build apk.
If it didn’t help, add certificates. Instruction How to generate a certificate.

We talk about it in the generic term of generating an application bundle (an exe, an apk, an app, an ipa). It’s not an Android Application Bundle (AAB) file (although we are working on AAB support though).

If you are not using any native extensions the build is done completely on your machine. And if it is a local build we package the APK without the need to a locally installed Android SDK. For every Defold release we prepare the required files (dex files etc) and use these to assemble an apk (zip, align, sign). None of this requires an Android SDK, just a couple of command line tools.

1 Like

I put in a self signed cert, changed the default package name (though I am not sure that actually helped anything) and it worked. I also opened the APK as a zip archive and, yes, despite the misleading folder name (armv7-android) what is being produced is in fact the 64 bit APK.

The APK for the Movement tutorial weighs in at just over 2Mb which is impressive - I have never been able to get anything under 4Mb for even a simple Hello World app out of either Cordova or Flutter.

One of the disappointments with the tutorials thus far - for a platform that purports to support mobiles (read touch screens) the tutorials are woefully inadequate. game.input_binding is not so much as configured to trap touch events. I tried that for myself and feel awfully proud at being able to drag that satellite around my phone screen with my finger :grin:

1 Like

We put a lot of effort in keeping the size down.
With the help of an “app manifest”, you can exclude core functionality you don’t need.
See the Manifestation Tool on how to easily generate such an app manifest.

EDIT: Note that will trigger a custom build on our cloud server.

1 Like

Great feedback! I’ll make a note of this and see if we can improve things. Thanks.