首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CFBundleIdentifier在上传macOS应用程序时发生碰撞,该应用程序由电子开发,使用电子生成器构建。

CFBundleIdentifier在上传macOS应用程序时发生碰撞,该应用程序由电子开发,使用电子生成器构建。
EN

Stack Overflow用户
提问于 2018-09-15 19:22:00
回答 1查看 391关注 0票数 1

我目前正在开发一个电子应用程序,我能够生成.app.pkg的macOS操作系统。虽然我可以从生成的.app运行它,但是当我试图上传.pkg (马斯)时,在AppStore连接上会出现以下错误:

代码语言:javascript
复制
CFBundleIdentifier Collision - 
The Info.plist CFBundleIdentifier value 'org.phantomjs' of 'phantomjs'
is already in use by another application.

我尝试将electron-builder电子更新为最新的稳定版本(2.0.9),并将更新为最新版本的(20.28.4)。我尝试在结果的org.phantomjs .app中搜索.app字符串,但是我无法找到带有该绑定标识符的Info.plist

这里我附上我的package.json,以防它有用:

代码语言:javascript
复制
{
  "name": "myAppName",
  "version": "0.0.1",
  "author": "Me <me@mymail.com>",
  "description": "My Description",
  "license": "MIT",
  "main": "./dist/electron/main.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/****.git"
  },
  "scripts": {
    "build": "node .electron-vue/build.js && electron-builder",
    "build:dir": "node .electron-vue/build.js && electron-builder --dir",
    "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
    "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
    "dev": "node .electron-vue/dev-runner.js",
    "lint": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter src",
    "lint:fix": "eslint --ext .js,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
    "pack": "npm run pack:main && npm run pack:renderer",
    "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
    "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
    "postinstall": "npm run lint:fix"
  },
  "build": {
    "productName": "myAppName",
    "appId": "this.is.a.real.appid",
    "buildVersion": "5",
    "directories": {
      "output": "build"
    },
    "files": [
      "dist/electron/**/*"
    ],
    "dmg": {
      "contents": [
        {
          "x": 410,
          "y": 150,
          "type": "link",
          "path": "/Applications"
        },
        {
          "x": 130,
          "y": 150,
          "type": "file"
        }
      ]
    },
    "mac": {
      "icon": "build/icons/icon.icns",
      "category": "public.app-category.developer-tools",
      "target": [
        {
          "target": "mas"
        }
      ]
    },
    "mas": {
      "entitlements": "build/entitlements.mas.plist",
      "entitlementsInherit": "build/entitlements.mas.inherit.plist",
      "icon": "build/icons/icon.icns",
      "category": "public.app-category.developer-tools"
    },
    "win": {
      "icon": "build/icons/icon.ico",
      "target": [
        {
          "target": "nsis"
        },
        {
          "target": "appx"
        }
      ]
    },
    "linux": {
      "icon": "build/icons"
    },
    "fileAssociations": [
      {
        "ext": "myExtension",
        "name": "My Project",
        "description": "File containing a My Project.",
        "icon": "build/icons/Project.icns",
        "role": "Editor",
        "isPackage": true
      }
    ],
    "copyright": "Copyright © 2018 Me"
  },
  "dependencies": {
    "@appshuttle.io/bell": "0.0.12",
    "@appshuttle.io/pollock": "0.0.28",
    "@appshuttle.io/turing": "0.0.16",
    "@fortawesome/fontawesome-svg-core": "^1.2.2",
    "@fortawesome/free-brands-svg-icons": "^5.0.13",
    "@fortawesome/free-regular-svg-icons": "^5.0.13",
    "@fortawesome/free-solid-svg-icons": "^5.0.13",
    "@fortawesome/vue-fontawesome": "0.1.1",
    "axios": "^0.16.1",
    "electron-updater": "^3.0.3",
    "email-validator": "^2.0.4",
    "grunt": "^1.0.3",
    "nedb": "^1.8.0",
    "p5": "^0.6.1",
    "path": "^0.12.7",
    "spectre.css": "^0.5.3",
    "vue": "^2.3.3",
    "vue-color": "^2.4.6",
    "vue-electron": "^1.0.6",
    "vue-router": "^2.5.3",
    "vuedraggable": "^2.16.0",
    "vuex": "^2.3.1"
  },
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-eslint": "^7.2.3",
    "babel-loader": "^7.1.5",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-env": "^1.7.0",
    "babel-preset-stage-0": "^6.24.1",
    "babel-register": "^6.24.1",
    "babili-webpack-plugin": "^0.1.2",
    "cfonts": "^1.2.0",
    "chalk": "^2.4.1",
    "copy-webpack-plugin": "^4.5.2",
    "cross-env": "^5.2.0",
    "css-loader": "^0.28.11",
    "del": "^3.0.0",
    "devtron": "^1.4.0",
    "electron": "^2.0.0",
    "electron-builder": "20.28.4",
    "electron-debug": "^2.0.0",
    "electron-devtools-installer": "^2.2.4",
    "eslint": "^4.19.1",
    "eslint-config-standard": "^10.2.1",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-html": "^3.1.1",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-node": "^5.1.1",
    "eslint-plugin-promise": "^3.8.0",
    "eslint-plugin-standard": "^3.1.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^0.11.2",
    "html-webpack-plugin": "^2.30.1",
    "mini-css-extract-plugin": "^0.4.1",
    "multispinner": "^0.2.1",
    "node-loader": "^0.6.0",
    "node-sass": "^4.9.2",
    "sass-loader": "^6.0.7",
    "style-loader": "^0.18.2",
    "url-loader": "^0.5.9",
    "vue-html-loader": "^1.2.4",
    "vue-loader": "^15.4.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.4.2",
    "webpack": "^3.12.0",
    "webpack-dev-server": "^2.7.1",
    "webpack-hot-middleware": "^2.22.3"
  }
}

提前谢谢你!

EN

回答 1

Stack Overflow用户

发布于 2018-09-18 19:42:14

找到了一个解决方案(如本Github问题中@countravioli所提到的):

我发现有一个名为app.asar.unpacked的文件在创建和签名.pkg后包含多个绑定标识符。删除.app中的这个文件,然后创建一个.pkg,对我来说不起作用,所以我使用了一个Build,就像Github问题中建议的那样。若要防止将该文件插入.pkg文件,请执行以下操作。为此,我在package.json的其余内容末尾添加了一个钩子到其构建部分:

代码语言:javascript
复制
package.json
{ //package.json Root ...
   build: {
      // build content ...
      "afterPack": "./afterPack.js"
   }
}

然后,一个人在我的package.json所在的文件夹中创建了一个名为package.json的文件,其内容如下:

代码语言:javascript
复制
const fs = require('fs');
const fse = require('fs-extra');
const path = require('path');
module.exports = function (params) {
    const unpackFile = path.join(params.appOutDir, 'YOUR_APP_NAME.app/Contents/Resources/app.asar.unpacked');
    console.log('EXISTS?', fs.existsSync(unpackFile));
    console.log("REMOVE", unpackFile);
    fse.removeSync(unpackFile);
};

我能够上传软件包到AppStore连接,没有任何问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52348084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档