Search code examples
android64-bitgluon-mobile

How to make the GluonMobile-based app compatible with the new Google 64-bit architecture policy?


I've got a message from Google saying that after August, 1 2019 all the apps using native code should be published as 64-bit versions, not only as 32-bit versions, otherwise any further updates will be rejected.

My GluonMobile-based app was listed as having only 32-bit libraries. APK Analyzer shows a group of .so files under \lib\armeabi which, as far as I understand, are those libraries:

libjavafx_font_freetype.so
libjavafx_iio.so
libdecora_sse.so
libprism_common.so
libprism_es2_monocle.so
libglass_monocle.so
libactivity.so
libwebview.so
libjavafx_font.so

There are some instructions available at google (https://developer.android.com/distribute/best-practices/develop/64-bit#building_with_android_studio_or_gradle) but I'm not sure where to put this config (in what portion of GluonMobile app's build.gradle file, if it's applicable in this case at all).

What exactly should I do in order to make the GluonMobile app compatible with the new Google policy?


Solution

  • The jfxmobile plugin has just been updated to provide support for 64 bits libraries, you will need to upgrade your projects to use version 1.3.17.

    Alternatively, if you want to keep an older version of the plugin you can do:

    jfxmobile { javafxportsVersion = '8.60.12' ... }

    But if you create a new project with the Gluon plugin for your IDE, now you will get:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'org.javafxports:jfxmobile-plugin:1.3.17'
        }
    }
    ...
    

    Then if you run ./gradlew android or ./gradlew androidInstall, you will get your apk with a lib folder like:

    lib
      |-- arm64-v8a
      |-- armeabi-v7a
    

    so support for 32 bits and 64 bits is granted now.

    Note that having two sets of libraries will increase the size of the apk in 2.5 MB.