You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Expo SDK44中expo-build-properties配置被eas-build忽略问题问询

解决Expo SDK44上传Google Play提示Target API Level为30的问题

问题分析

你已通过expo-build-properties配置Android的targetSdkVersion为31,但上传AAB时仍被提示当前Target API Level是30,这通常是因为配置未正确生效,或是构建缓存复用了旧配置。

解决方案

1. 确认expo-build-properties版本适配SDK44

Expo SDK44对应的expo-build-properties插件版本为~0.2.1,版本不匹配会导致配置失效:

  • 检查当前版本:
    npm list expo-build-properties
    
  • 若版本不符,安装适配版本:
    npx expo install expo-build-properties@0.2.1
    

2. 验证app.json配置完整性

确保plugins数组正确嵌套在expo字段下,完整配置示例:

{
  "expo": {
    "name": "你的应用名称",
    "slug": "your-app-slug",
    // 其他基础配置
    "plugins": [
      [
        "expo-image-picker",
        {
          "photosPermission": "This app needs to access your photos to let you share them with your friends."
        }
      ],
      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 31,
            "targetSdkVersion": 31,
            "buildToolsVersion": "31.0.0"
          },
          "ios": {
            "deploymentTarget": "13.0"
          }
        }
      ]
    ]
  }
}

3. 清除构建缓存并重新构建

缓存会保留旧配置,必须清除后重新生成AAB:

  • 若使用传统Expo构建:
    expo r -c # 清除本地缓存
    expo build:android -t app-bundle # 重新构建AAB
    
  • 若使用EAS Build:
    eas build --clear-cache --platform android # 清除远程缓存并构建
    

4. 验证构建日志

重新构建时,查看日志中是否输出targetSdkVersion: 31,确认配置已被应用。

内容的提问来源于stack exchange,提问作者gigapico00

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.14 23:26:05