将minSdkVersion设为23及以上时Flutter应用触发Google Play Console 16KB页面大小警告的问题求助
将minSdkVersion设为23及以上时Flutter应用触发Google Play Console 16KB页面大小警告的问题求助
大家好,我最近在用最新稳定版Flutter开发时碰到了一个特别费解的问题——Google Play Console弹出的16KB页面大小警告。
上周我在自己的实际项目里收到了这个警告,但Play Console的报告里完全没指出有问题的文件。我试了几乎所有能找到的修复建议:调整NDK版本、修改AGP配置、调整ABI过滤器等等,但都没解决问题。
直到昨天我偶然发现了一个奇怪的规律:
- 用
flutter create testing新建一个完全干净的项目,在Android Studio里直接构建App Bundle,上传到Play Console检查时完全没有警告; - 但只要把项目里的
minSdkVersion改成23或更高,其他任何配置都不动,重新构建App Bundle后,Play Console在检查时立刻就会弹出这个16KB页面大小警告。
我这边试了好几次都能稳定复现这个情况,所以想请各位朋友帮忙在自己的开发环境里测试一下,步骤很简单:
- 新建一个干净的Flutter项目
- 使用默认的minSdkVersion构建App Bundle,上传到Play Console检查是否有警告
- 将minSdkVersion修改为23或更高,重新构建后再次检查
我的开发环境信息:
Flutter Doctor Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 3.32.8, on Microsoft Windows [Version 10.0.19045.6159], locale en-US) [√] Windows Version (10 Pro 64-bit, 22H2, 2009) [√] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [√] Chrome - develop for the web [X] Visual Studio - develop Windows apps X Visual Studio not installed; this is necessary to develop Windows apps. Please install the "Desktop development with C++" workload, including all of its default components [√] Android Studio (version 2025.1.2) [√] Connected device (4 available) [√] Network resources
额外补充环境细节:
- Flutter 稳定版 3.32.8,Windows 10 Pro 64位(22H2)
- Android SDK版本 36.0.0
- Android Studio 2025.1.2
- Gradle 8.12,AGP 8.7.3
- NDK 27.0.12077973
相关配置文件内容:
app/build.gradle.kts
plugins { id("com.android.application") id("kotlin-android") // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id("dev.flutter.flutter-gradle-plugin") } android { namespace = "com.example.just_for_test" compileSdk = flutter.compileSdkVersion ndkVersion = "27.0.12077973" compileOptions { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 } kotlinOptions { jvmTarget = JavaVersion.VERSION_11.toString() } defaultConfig { // TODO: Specify your own unique Application ID applicationId = "com.example.just_for_test" // You can update the following values to match your application needs. minSdk = 23 targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName // Attempted fix for 16KB page size compatibility ndk { abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64") } } buildTypes { release { // Signing with debug keys for testing purposes signingConfig = signingConfigs.getByName("debug") isMinifyEnabled = true isShrinkResources = true } } // Additional attempted configuration for 16KB page size packaging { resources { pickFirsts += listOf("**/libc++_shared.so", "**/libjsc.so") } } } flutter { source = "../.." }
Gradle Wrapper配置
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
settings.gradle
pluginManagement { val flutterSdkPath = run { val properties = java.util.Properties() file("local.properties").inputStream().use { properties.load(it) } val flutterSdkPath = properties.getProperty("flutter.sdk") require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } flutterSdkPath } includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" id("com.android.application") version "8.7.3" apply false id("org.jetbrains.kotlin.android") version "2.1.0" apply false } include(":app")
想问一下有没有朋友也碰到过这个特定的问题?如果有的话,有没有找到可靠的修复方法?特别希望大家能先按照我上面说的步骤测试一下,再分享你的结果,非常感谢!
内容来源于stack exchange
相关产品推荐
相关产品推荐

