My application is too large to be uploaded to the Google play store?

Viewed 4067

I'm currently in the process of submitting my first app in the Google play store, and it's been a painful one. Right now I'm almost done, but now I get the error

> "Your App Bundle contains the following configurations where the
> initial install would exceed the maximum size of 150 MB: ARMEABI_V7A"

I already use an .AAB format, rather than an .APK, but it's still too large, and with the updates I have planned for it, it will only get larger. Reason being is that it's an AR app with many unique 3D meshes and audio fragments etc.

I've heard about APK extention files, but I'm not quite sure how they work. Honestly, I'm pretty new to all of this. I know there are some apps in the play store that are way larger than what I'm trying to make, so it is possible. I just don't know how.

I've hit bumps in the road on every turn trying to submit this app, and it's stressing me out since I'm working towards a deadline. Any help would be greatly appreciated and I'd be forever in your debt

1 Answers

I know this question is old, but I just ran into it myself and I haven't found a good answer out there yet, especially if you're using Unity's Cloud Build service. You used to be able to split your binary into two files, an APK with the code and your first scene and an OBB file with everything else, but as of August 2021, this approach is no longer supported by Google Play.

The first thing you need to do is download the Unity plugins provided by Google here: https://github.com/google/play-unity-plugins/releases. I just downloaded the whole zip file, unzipped it, and put everything in a new folder I created in my project (Assets/GooglePlayPlugins).

Next, make sure that “Split Application Binary” is unchecked in your player settings (Player Settings -> Android -> Publishing Settings); that’s the checkbox for the old OBB approach. The next steps are a little different, depending on if you’re doing a local build or using Cloud Build.

Local Build

If you have the plugins from Google installed in your project, then you should have a new menu available called “Google”. In there go “Google -> Android App Bundle -> Asset Delivery Settings” and check the box that says “Separate Base APK Assets”. Then, instead of using the regular build dialog from Unity, build your project using “Google -> Build Android App Bundle”.

Cloud Build

Assuming you don’t check the Library folder into source control (aka, assuming you’re not crazy), then you need to have some code in a Pre-Build script that sets “Separate Base APK Assets” the setting for you (At least currently….Cloud Build hasn’t exposed it as an option in their UI yet). I do mine in a Pre-Export Method so I can use a C# script instead of a shell script. Here’s my code:

using Google.Android.AppBundle.Editor.Internal.AssetPacks;

public class CloudBuild
{
#if UNITY_CLOUD_BUILD
    public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
    {
        var assetDeliveryConfig = AssetDeliveryConfigSerializer.LoadConfig();
        assetDeliveryConfig.Refresh();
        assetDeliveryConfig.SplitBaseModuleAssets = true;
        AssetDeliveryConfigSerializer.SaveConfig(assetDeliveryConfig);
    }
#endif
}

In addition to that code, you’ll also need to set a couple of options in the Cloud Build UI. Go to your Build Config and then to Advanced Options. Check the boxes that say “Build App Bundles (.aab)” and “Build Asset Packs”. Also make sure the box that says Split Application Binary is NOT checked.

Either Way

With a local build or with Cloud Build, you’ll know you did it right by taking the resulting AAB file and unzipping it. In the extracted folder you should see two subfolders, “base” and “base_assets”. If you only see “base” then something went wrong. Another indicator of correctness is that the size of the compressed AAB file should be comparable to your old APK or APK+OBB size.

Related