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

Expo 51中app.json提示‘plugins属性不被允许’问题求助

解决Expo 51中app.json配置plugins时的“Property 'plugins' is not allowed”警告

你遇到的问题有两个核心原因,直接修正就能解决:

1. plugins配置位置错误

当前你把plugins放在了expo对象的外部,而根据Expo的规范,plugins必须是expo对象的子属性。

2. 多插件配置格式错误

你把expo-font和expo-secure-store的配置合并在了同一个数组里,每个插件的配置应该单独作为plugins数组的一项。

修正后的完整app.json代码

{
  "expo": {
    "name": "....",
    "slug": ".....",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon1.png",
    "userInterfaceStyle": "dark",
    "splash": {
      "image": "./assets/FullLogo.png",
      "resizeMode": "contain",
      "backgroundColor": "#000000"
    },
    "ios": {
      "supportsTablet": false,
      "buildNumber": "1",
      "bundleIdentifier": "..."
    },
    "extra": {
      "eas": {
        "projectId": "..."
      }
    },
    "plugins": [
      [
        "expo-font",
        {
          "fonts": [
            "assets/Fonts/RobotoSlab-Black.ttf",
            "assets/Fonts/RobotoSlab-Bold.ttf",
            "assets/Fonts/RobotoSlab-ExtraBold.ttf",
            "assets/Fonts/RobotoSlab-ExtraLight.ttf",
            "assets/Fonts/RobotoSlab-Light.ttf",
            "assets/Fonts/RobotoSlab-Medium.ttf",
            "assets/Fonts/RobotoSlab-Regular.ttf",
            "assets/Fonts/RobotoSlab-SemiBold.ttf",
            "assets/Fonts/RobotoSlab-Thin.ttf"
          ]
        }
      ],
      [
        "expo-secure-store",
        {
          "faceIDPermission": "Allow $(Pumpzoid) to access your Face ID biometric data."
        }
      ]
    ]
  }
}

修正后,警告就会消失,两个插件的配置也能正常生效。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.23 01:50:12