Publishing multiple APK files to Google Play Store

I have enabled this option to generate device-specifc APKs to reduce the APK size and got 4 outputs (*-x86.apk, *-arm.apk, *-x86_64.apk, *-arm64.apk).

When I try to upload them to Google Play, it accepts the first one, and rejects the other 3 ones citing all 4 APKs have same version code.

Rules for uploading multiple APKS to play store :

  1. All APKs you publish for the same application must have the same package name and be signed with the same certificate key.
  2. Each APK must have a different version code, specified by the android:versionCode attribute.
  3. Each APK must not exactly match the configuration support of another APK.

https://developer.android.com/google/play/publishing/multiple-apks

Can anyone advice how we could publish apps like these to Google Play? If I disable the multiple APKs option, then the output APK will be around 90 MB, and device specific APK is only 40MB.

During the app build process, the compiler should assign a different version code to each APK. This was not configured correctly in 7.0. It has been fixed in 7.0.1, so each generated APK has a different four digit version code.

1 Like

Thanks, it is working now and we were able to upload multiple APKs to Google Play.

How do I get to this “Multiple APKs” setting?

The Multiple APKs setting is visible if needed. The two situations that warrant this setting is:

  1. using Crosswalk
  2. enabling sharing verses using audio or video (adds FFmpeg)

Both of these libraries are relatively large.

BEWARE: If you encourage or depend on Bluetooth or Wifi sharing between users, enabling this feature will limit the type of devices that the users will be able to share the app with. By keeping the app in one APK, then the end user will be able to share with the most people.

NOTE: Scriptoria does not currently support Multiple APKs. We still need to make changes to Scriptoria to handle publishing multiple APKs. It is the next feature on the list (after publishing HTML and PWAs to websites).

Thanks,
Chris

@ChrisHubbard I was about to start a new thread, but decided maybe it fits here. On the Google Playstore, after I upload my APK - in the review process, I get a warning message that doesn’t allow me to Start Rollout to Production. I originally thought it was my 98MB app size, but after I removed FFmpeg it was down to 47MB. But it still gives me the same error message about Unoptimized APK:


Does this mean that I need to build Multiple APKs?

Like @Ron_Lockwood says, I can’t find the option to build Multiple APKs for -x86, -arm, -x86_64, -arm64.
@richard I’ve got the latest SAB 7.2 (July 9) and I still don’t see where to activate Multiple APKs option.

Here is where the Google Playstore says my single app should work on a handful of “Native platforms” (but apparently the Playstore thinks this makes my apps too big)


With this build I still get the same message about Unoptimized APK and so I’m not able to start the rollout to production on the Playstore.

To create multiple APKs for different device architectures, there is a checkbox on the App > APK tab. This will appear when you are using FFmpeg or Crosswalk.

Ok, thanks @richard, but I’m still getting the error.

Originally I thought the problem was my 98MB APK file size, so I had unselected the “Allow saving as video” (FFmpeg) on the Verse on Image tab. That significantly reduced file size, but in SAB it no longer gave me the option to make Multiple APKs. It might be nice if the Multiple APKs option was available, even if FFmpeg is not used. In my case the files are large because I want to fit as much audio as possible.

I was now able to create Multiple APKs for -arm, -x86, -x86_64 and -arm64. However, when I uploaded these for APKs, I’m still getting the same error about Unoptimized APK for all 4 of the APK files.


I see the 4 letter version code seems to be 20xx for -arm, 30xx for -arm64, 80xx for -x86 and 90xx for -x86_64 (where XX is the version number 10 that I had added in SAB).

The “Unoptimized APK” message is a warning, rather than an error.
Are there any other pages in the Store listing that you still need to complete?

If you are not using FFmpeg or Crosswalk libraries, you should not need to create multiple APKs. Without Crosswalk or FFmpeg, the architecture specific code does not take up very much space.

Yes, I’m still trying to complete other pages. But the order of tasks to complete is not self evident on the Google Playstore Dashboard. For example I started with the Store listing, then when I moved to Content rating but it wouldn’t allow me to continue without first uploading an APK. From what I gather, now that the APK is uploaded I’ll go back and complete the other steps (including content rating) before returning to the App releases tab to officially roll out the release.

I was able to complete my upload to Google Play Store, and also Start Rollout to Production. Now I’m just waiting for their approval - apparently it will take longer than usual (due to Covid-19).

1 Like