macos - 错误 ITMS-90283 : Invalid Provisioning Profile. bundle 中包含的配置文件无效 [缺少代码签名证书]

标签 macos electron code-signing electron-builder

版本 :

  • Electron :5.0.1
  • electron-builder :21.2.0
  • Electron 公证:0.1.1
  • Electron 网络包:2.7.4
  • 正在处理:MacOS Catalina 10.15
  • dmg文件工作正常。但是当我尝试通过 Transporter 进行验证时,出现以下错误。

    错误

    error

    构建配置
    "build": {
        "appId": "<APP_ID>",
        "productName": "<PRODUCT_NAME",
        "copyright": "<COMPANY_NAME>",
        "afterSign": "scripts/notarize.js",
        "directories": {
          "buildResources": "resources",
          "output": "release"
        },
        "mac": {
          "hardenedRuntime": true,
          "gatekeeperAssess": false,
          "category": "public.app-category.developer-tools",
          "target": ["mas"],
          "icon": "resources/icon.icns",
          "identity": "<IDENTITY>",
          "provisioningProfile": "build/mac.provisionprofile",
          "type": "distribution",
          "electronLanguages": ["en"],
          "entitlements": "build/mac.plist",
          "entitlementsInherit": "build/mac.plist"
        },
        "mas": {
          "hardenedRuntime": false,
          "provisioningProfile": "build/mas.provisionprofile",
          "type": "distribution",
          "electronLanguages": ["en"],
          "entitlements": "build/entitlements.mas.plist",
          "entitlementsInherit": "build/entitlements.mas.inherit.plist"
        },
        "dmg": {
          "sign": false,
          "contents": [
            {
              "x": 130,
              "y": 220
            },
            {
              "x": 410,
              "y": 220,
              "type": "link",
              "path": "/Applications"
            }
          ]
        },
        "files": [
          "dist/",
          "node_modules/",
          "app_prod.html",
          "main.prod.js",
          "main.prod.js.map",
          "package.json",
          "assets/"
        ],
        "win": {
          "target": ["nsis"]
        },
        "linux": {
          "target": ["deb", "AppImage"],
          "category": "Development"
        }
    },
    

    notarize.js
    require('dotenv').config();
    const { notarize } = require('electron-notarize');
    
    exports.default = async function notarizing(context) {
      const { electronPlatformName, appOutDir } = context;
      if (electronPlatformName !== 'darwin') {
        return;
      }
    
      const appName = context.packager.appInfo.productFilename;
    
      return await notarize({
        appBundleId: process.env.BUNDLE_ID,
        appPath: `${appOutDir}/${appName}.app`,
        appleId: process.env.APPLE_ID,
        appleIdPassword: process.env.APPLE_ID_PASS,
      });
    };
    

    mac.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
        <true/>
        <key>com.apple.security.network.client</key>
        <true/>
        <key>com.apple.security.files.user-selected.read-write</key>
        <true/>
        <key>com.apple.security.cs.allow-jit</key>
        <true/>
        <key>com.apple.security.cs.allow-dyld-environment-variables</key>
        <true/>
        <key>com.apple.security.cs.disable-library-validation</key>
        <true/>
      </dict>
    </plist>
    
    

    entitlements.mas.plist
    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>com.apple.security.app-sandbox</key>
        <true/>
        <key>com.apple.application-identifier</key>
        <string>APPLICATION_ID</string>
        <key>com.apple.developer.team-identifier</key>
        <string>TEAM_ID</string>
        <key>com.apple.security.application-groups</key>
        <array>
          <string>BUNDLE_ID</string>
        </array>
        <key>com.apple.security.network.client</key>
        <true/>
    
        <key>com.apple.security.files.user-selected.read-only</key>
        <true/>
    
        <key>com.apple.security.files.downloads.read-write</key>
        <true/>
    
        <key>com.apple.security.files.user-selected.read-write</key>
        <true/>
    
        <key>com.apple.security.files.all</key>
        <true/>
        <key>com.apple.security.application-groups</key>
        <string>security</string>
      </dict>
    </plist>
    
    
    
    

    entitlements.mas.inherit.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>com.apple.security.app-sandbox</key>
        <true/>
        <key>com.apple.security.inherit</key>
        <true/>
      </dict>
    </plist>
    

    我的证书

    certficates

    构建文件夹

    Provision

    配置文件

    Provision

    另外,Notarization步骤也通过了。这里有什么遗漏吗?

    最佳答案

    我有 same error message with a newer version of electron .对我来说真正的问题是我有多个 x.provisionprofile s,而不是 embedded.provisionprofile (如 Electron 构建器文档所述)使用了其他一个,从而导致此错误。您可以在此处查看完整的源代码和build设置:
    https://github.com/johannesjo/super-productivity

    关于macos - 错误 ITMS-90283 : Invalid Provisioning Profile. bundle 中包含的配置文件无效 [缺少代码签名证书],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59082000/

    相关文章:

    python - MacVim vdebug python 错误

    c++ - CMake 没有生成 Make 文件

    macos - 在 OS X Server 上运行的 Tomcat 6 上启动时 Sonar 抛出异常

    sqlite - 打包的 Electron App 找不到模块 sqlite3

    javascript - BrowserWindow 控制台中的安全警告( Electron ^9.2.0)

    javascript - 在与 Electron 相同的 BrowserWindow 中有两个独立的(在历史/cookies/localstorage 方面)BrowserViews

    xcode - Xcode 4.6.3 中 Dropbox API 的代码设计失败 : "code object is not signed at all"

    android - 如何自动签署应用程序以进行计费?

    macos - 如何在 mac 优胜美地上撤消 `brew link --force openssl`

    cocoa - SecurityKit问题,雪豹