手动部署出现错误 "app.json must include a JSON object "

manual deployment getting an error "app.json must include a JSON object "

我正在尝试对我的 react-native 项目进行手动部署,但我一直收到此错误

[15:52:27] app.json 必须包含一个 JSON 对象。

[15:52:27] 错误:app.json 必须包含一个 JSON 对象

我已经阅读了关于这个问题的每一个主题,但找不到解决方案,有什么想法吗?

{
  "expo": {
    "name": "*********",
    "slug": "*********",
    "privacy": "public",
    "sdkVersion": "33.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.91",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/images/splash.png",
      "resizeMode": "cover",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "*****************": 0
    },
    "assetBundlePatterns": ["assets/*"],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.*********.******",
      "config": {
        "usesNonExemptEncryption": false
      }
    },
    "android": {
      "package": "com.*********.**********",
      "versionCode": 91,
      "permissions": [
        "NOTIFICATIONS",
        "LOCATION",
        "ACCESS_NETWORK_STATE",
        "VIBRATE"
      ]
    },
    "description": "READY FOR TESTING"
  }
}

就我而言,这是权限问题。只需尝试 PowerShell 或终端的管理模式。

我遇到了同样的问题。 运行 提升权限没有解决我的问题。但是,将 ios 和 android 直接放在 sdkVersion 下方解决了我的问题。例如

  {
      "expo": {
        "name": "*********",
        "slug": "*********",
        "privacy": "public",
        "sdkVersion": "33.0.0",
        "ios": {
          "supportsTablet": true,
          "bundleIdentifier": "com.*********.******",
          "config": {
            "usesNonExemptEncryption": false
          }
        },
        "android": {
          "package": "com.*********.**********",
          "versionCode": 91,
          "permissions": [
            "NOTIFICATIONS",
            "LOCATION",
            "ACCESS_NETWORK_STATE",
            "VIBRATE"
          ]
        },
        "platforms": [
          "ios",
          "android"
        ],
        "version": "1.0.91",
        "orientation": "portrait",
        "icon": "./assets/icon.png",
        "splash": {
          "image": "./assets/images/splash.png",
          "resizeMode": "cover",
          "backgroundColor": "#ffffff"
        },
        "updates": {
          "*****************": 0
        },
        "assetBundlePatterns": ["assets/*"],
        "description": "READY FOR TESTING"
      }
    }