上传App Bundle至Play Console遇报错:需升级Play Core至兼容Android14版本
报错详情
Update your com.google.android.play:core:1.10.3 Maven dependency to an Android 14 compatible version! Your current com.google.android.play:core:1.10.3 library is incompatible with targetSdkVersion 34 (Android 14), which introduces a backwards-incompatible change to broadcast receivers. As a reminder, from August 31, 2024, Google Play requires all new app releases to target Android 14. Update to the latest library version dependency to avoid app crashes.
具体解决步骤
升级Play Core库到兼容版本
Google官方明确1.10.3版本不支持Android 14,需升级到1.12.0及以上稳定版。在Module级别的build.gradle文件中修改依赖:implementation 'com.google.android.play:core:1.12.0'若使用Kotlin或动态特性模块,同步升级对应依赖:
implementation 'com.google.android.play:core-ktx:1.12.0' // Kotlin环境 implementation 'com.google.android.play:core-feature:1.12.0' // 动态特性模块排查并排除间接依赖的旧版本
部分第三方库可能隐式依赖旧版Play Core,导致编译后仍存在1.10.3版本。执行Gradle命令查看依赖树:./gradlew app:dependencies找到所有引用旧版Play Core的第三方库,在依赖声明中添加排除规则:
implementation('第三方库坐标') { exclude group: 'com.google.android.play', module: 'core' }清理重构项目后重新打包
- 执行Android Studio的
Build → Clean Project清理缓存 - 执行
Build → Rebuild Project重新编译 - 生成新的签名App Bundle(
Build → Generate Signed Bundle/APK)后上传
- 执行Android Studio的
确认targetSdkVersion配置
确保build.gradle中已正确设置目标SDK版本为34:android { defaultConfig { targetSdkVersion 34 } }
内容的提问来源于stack exchange,提问作者D.J

