Notes on steps I took to successfully get a 64-bit APK published to the Google App Store

#1

With great thanks to @mkrebs for his assistance, I was finally able to get a codesigned 64-bit APK published to the Google App Store.

Since it also took banging my head against opaque errors and seemingly-undocumented and/or mis-documented (especially in Android docs) requirements on and off for about ten days, here are my notes on what I can remember of what steps were needed.

  • Install the Android SDK (I’d already done this, and don’t remember the details - I didn’t need to re-do it.)
  • Install Android Studio 3.4.1 from https://developer.android.com/studio/archive
  • Install the Android NDK (version r15c)
  • Download openFrameworks from the NIGHTLY BUILDS (0.10.1 doesn’t have 64-bit support) found at the bottom of https://openframeworks.cc/download/ (I used of_v20191031_android_nightly.tar.gz)
  • Use the Project Generator from the nightly build (I’m on Windows so used the Windows version) to generate a new project with the name you will want, including any AddOns you want. (Don’t even have an empty folder with that name already.)

  • Edit the new project’s AndroidManifest.xml so that:
    • “package” is set to the name you will want to identify your app to the Play Store, so maybe com.YourCompany.YourApp.
    • but do NOT change android:name to be congruent with that - leave it like the project generator set it, or else your app will stop before even entering debugging, unable to call the Java wrapper to OF.
    • if you don’t want your app to auto-rotate its display, set android:screenOrientation=“portrait” in <activity>

  • Edit the project’s build.gradle so that it has (the only versions that worked for me were):
    • classpath ‘com.android.tools.build:gradle-experimental:0.9.3’
    • compileSdkVersion = 28
    • buildToolsVersion = “28.0.3”
    • minSdkVersion.apiLevel = 21
    • targetSdkVersion.apiLevel = 28
    • platformVersion = “21”

  • in gradle-wrapper.properties, keep distributionUrl=https://services.gradle.org/distributions/gradle-3.3-all.zip

  • Run Android Studio.
  • Make sure no project is already loaded in Android Studio.
  • Import (not open) the new project.
  • It will ask you for NDK location, either put the path in local.properties or click Project Structure and select the NDK location. i.e. you add a line after the sdk.dir with something like ndk.dir=C:\android-ndk-r15c - but with whereever you put the NDK on your machine.
  • In the Project window (probably in the upper-left of the Android Studio UI), select the section of your UI that is your project’s name
  • Select Build -> Select Build Variant (sometimes greyed out unless the project is selected)
  • For both your project, and for openFrameworksProject, set the target to the same build target you want to test-run.
  • You may need to Clean Project after making (who knows what) changes before doing Make Project.
  • Make Project and then Run to test your app.

  • To codesign, you need to first edit your project’s build.gradle so that:
    • versionCode needs to be increased for every codesigned APK, so it will need to be different for the 32-bit APK and the 64-bit APK.
    • versionName needs to be a name for the release you’ll set also in the Google Play Console web UI (e.g. Version 1.0.1)
  • Then you need to Sync to Gradle in Android Studio
  • Then do Build -> Generate Signed Bundle / APK
  • I selected APK, not wanting to submit to Google’s bundle plan
  • Hit Next and provide your keystore stuff (I’m not going into that here - nothing needed to change for me)
  • If you’re using an APK like me (rather than a Bundle), select only one at a time, i.e. arm7Release, and both V1 and V2 signatures, and press Finish.
  • Then go back to the top of this paragraph and do it again, updating the versionCode for the 64-bit version, and then codesigning for arm64Release.

  • Then go to the Google Play Console, fight off all the new requirement dialogs and required trainings and whatever, and when you make it to the part where you upload APKs, be sure to upload the 32-bit APK before the 64-bit APK, or it may sit in limbo “processing” forever.
3 Likes
64 Bit Support Deadline Aug. 2019 - Play Store
How to build OF 0.9.8 for android 64bit
#2

This is highly valuable and as forum posts tend to get lost, I’d like to see this somewhere more permanent, maybe the oF website/guides or the oF wiki.

@edapx is leading the effort in a bit of reorganising documentation etc, would like to check in with him on where this can go.

1 Like
#3

@Drazinut, thank you very much for this. Your tips are very much appreciated. I’ll be implementing these steps to finally get my app ready for Google Play.

With luck I might be able to launch the app before end of this year. Thank you so much for this.

1 Like
#4

You’re very welcome!

The thought of every person spared some suffering by this post comforts my past frustration.

I felt compelled by compassion to share what I’d learned, and also to write it down for my future self.

If you have problems or questions, feel free to ask and I’ll see if I can help.

1 Like
#5

Finally, that 64bit option shows itself!
00%20PM

Only need to make the shaders work and we’re good to go. Seems like GLSL ES don’t seem to work on the Android port ever since the shift to Android Studio from Eclipse. Might as well get my hands dirty on this one. Fingers crossed.

1 Like