首页 > 解决方案 > Electron Builder Appx:包清单无效

问题描述

我试图用 Electron Builder 将我的应用程序打包为 Appx 文件,以便在 Windows 应用商店中发布它。但是我不断收到这个奇怪的错误,它说我的清单文件不可用:

MakeAppx : error: Package creation failed.
MakeAppx : error: 0x80080204 - The specified package format is not valid: The package manifest is not valid.

实际上,我有一个工作 AppxManifest.xml 但不能在电子生成器中使用它。我的身份变量也应该是正确的(我在其他工具中使用它并成功发布)。所以我有点卡在这里。

这是我的 package.json

{
  "name": "***",
  "version": "1.0.1",
  "description": "Made with love <3",
  "main": "index.js",
  "scripts": {
    "start": "electron .",
    "pack": "electron-builder --dir",
    "dist": "electron-builder"
  },
  "author": "***",
  "license": "All Rights Reserved",
  "dependencies": {
    "knex": "^0.21.6",
    "sqlite3": "^5.0.0"
  },
  "devDependencies": {
    "electron": "^10.1.2",
    "electron-builder": "^22.9.1"
  },
  "build": {
    "productName": "***",
    "appId": "***.com",
    "directories": {
      "buildResources": "assets"
    },
    "win": {
      "icon": "assets/icon.ico",
      "target": [
        "nsis",
        "appx"
      ]
    },
    "nsis": {
      "oneClick": false,
      "perMachine": true,
      "allowToChangeInstallationDirectory": true
    },
    "appx": {
        "identityName": "NumberPublishername.Appname",
        "publisher": "CN=LongNumber",
        "publisherDisplayName": "Publishername",
        "applicationId": "Appname"
    }
  }
}

标签: electronelectron-builder

解决方案


问题是这一行Made with love <3<因为 XML 无效,所以那里不允许使用该字符。可悲的是控制台没有说什么是错的。


推荐阅读