My Experience Fixing Flutter Android Google Play 16 KB Page Size Violation

How to prepare your Flutter Android app for Google Play's 16 KB page size requirements

Previously, I was doing some Google Play homework to update my app’s target SDK to at least Android SDK 35.

I thought I was done, but then Google sent me another violation email stating that my app now requires a 16 KB page size.

Google Play 16 KB Page Size Requirement
Google Play 16 KB Page Size Requirement

The deadline is November 1, 2025. I have a few weeks left, so here I am doing yet another annual Google Play homework.

APK Check First

The first thing I did was check the APK file. To do that, I used Android Studio’s File > Profile or Debug APK feature.

Profile or Debug APK
Profile or Debug APK

From the profiler, I could see that many dependencies were using 4 KB LOAD section alignment, including Flutter itself.

Flutter 4 KB LOAD Section Alignment
Flutter 4 KB LOAD Section Alignment

So, I needed to update the SDK and some dependencies.

Flutter SDK Update

Based on the APK profile information, the first step was to update the Flutter SDK.

I was using Flutter v3.10.6. At the time of writing this tutorial, the latest stable version available is v3.35.5.

Once I updated the Flutter SDK version, I tried to build the app, but it threw some errors.

Flutter’s app_plugin_loader Problem

The first issue I encountered was the following error message:

FAILURE: Build failed with an exception.

* Where:
Script '/Users/junian/fvm/versions/3.35.5/packages/flutter_tools/gradle/app_plugin_loader.gradle' line: 9

* What went wrong:
A problem occurred evaluating script.
> You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is not possible anymore. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply

Resolving this is straightforward.

Remove the following lines from the android/build.gradle file (your project may differ slightly). Take note of the ext.kotlin_version and com.android.tools.build:gradle values, as you’ll need them later.

 1- buildscript {
 2-     ext.kotlin_version = '1.9.25'
 3-     repositories {
 4-         google()
 5-         mavenCentral()
 6-     }
 7- 
 8-     dependencies {
 9-         classpath 'com.android.tools.build:gradle:8.5.0'
10-         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-         classpath 'com.google.gms:google-services:4.3.15'
12-     }
13- }
android/build.gradle

Next, remove the following section from android/settings.gradle:

 1- include ':app'
 2- 
 3- def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
 4- def properties = new Properties()
 5- 
 6- assert localPropertiesFile.exists()
 7- localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
 8- 
 9- def flutterSdkPath = properties.getProperty("flutter.sdk")
10- assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11- apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
android/settings.gradle

And replace it with the following settings. Make sure the value of com.android.application matches com.android.tools.build:gradle. The value of org.jetbrains.kotlin.android should match ext.kotlin_version.

 1pluginManagement {
 2    def flutterSdkPath = {
 3        def properties = new Properties()
 4        file("local.properties").withInputStream { properties.load(it) }
 5        def flutterSdkPath = properties.getProperty("flutter.sdk")
 6        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
 7        return flutterSdkPath
 8    }()
 9
10    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11
12    repositories {
13        google()
14        mavenCentral()
15        gradlePluginPortal()
16    }
17}
18
19plugins {
20    id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true
21    id "com.android.application" version "8.5.0" apply false
22    id "org.jetbrains.kotlin.android" version "1.9.25" apply false
23}
24
25include ":app"
android/settings.gradle

Next, remove this part from the android/app/build.gradle file:

 9- def flutterRoot = localProperties.getProperty('flutter.sdk')
10- if (flutterRoot == null) {
11-     throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12- }
android/app/build.gradle

Still in the same file, remove the following section:

44- apply plugin: 'com.android.application'
45- apply plugin: 'kotlin-android'
46- apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
47- apply plugin: 'com.google.gms.google-services'
android/app/build.gradle

And replace it with (notice the third line is changed):

1plugins {
2    id 'com.android.application'
3    id 'kotlin-android'
4    id "dev.flutter.flutter-gradle-plugin"
5    id 'com.google.gms.google-services'
6}
android/app/build.gradle

Now we’re ready to resolve the next issue.

Raising Android Minimum SDK

Another issue was the need to update the Android minimum SDK.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:ReleaseMinSdkCheck'.
> com.flutter.gradle.DependencyValidationException: Error: Your project's minimum Android SDK (flavor='release') version (21) is lower than Flutter's minimum supported version of 23. Please upgrade your minimum Android SDK (flavor='release') version.
  Alternatively, use the flag "--android-skip-build-dependency-validation" to bypass this check.

  Potential fix: Your project's minimum Android SDK version is typically defined in the android block of the app-level `build.gradle(.kts)` file (/Users/junian/Projects/stunting-mobile/src/android/app/build.gradle(.kts)).

To fix this, open the android/local.properties file and set the value:

- flutter.minSdkVersion=21
+ flutter.minSdkVersion=24
android/local.properties

Dependency and API Issues

After updating the Flutter SDK, I needed to update some dependencies by running:

flutter pub upgrade --major-versions

There will likely be some API breaking changes. Update your Flutter code to follow the new APIs.

In my case, I updated dotted_border from version 2 to version 3 and made changes like:

DottedBorder(
-    borderType: BorderType.Circle,
+    options: CircularDottedBorderOptions(
        strokeWidth: 10,
        color: const Color.fromARGB(255, 134, 172, 237),
        padding: EdgeInsets.all(2),
+   )
)

Recheck and Submit to Google Play

After making all the changes, I built the app again. Before submitting to Google Play, I rechecked it with Profile or Debug APK.

Profile or Debug APK Fix
Profile or Debug APK Fix

As you can see, there is no 16 KB warning anymore. So it’s safe to submit the new version to Google Play.

Once submitted, wait for the review.

After the submission review is finished, you can check again on your Google Play Console. If everything went well, you’ll see the following message from Google:

16KB memory page size violation fixed
16KB memory page size violation fixed

Conclusion

That’s all for today. I can’t wait to see what Google Play will assign as developer homework next year.

Thanks for reading and see you next time!

References