electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.32k stars 491 forks source link

When uploading a pkg file through apple transporter, it prompts that the icon does not exist in the pkg file #2769

Closed BlessedChild closed 1 year ago

BlessedChild commented 2 years ago

Pre-flight checklist

Electron Forge version

6.0.0-beta.63

Electron version

v17.1.0

Operating system

12.3 Beta(21E5212f)

Last known working Electron Forge version

No response

Expected behavior

Electron's Mac App Store Submission Guide should be accurate and up to date, I hope I can successfully submit our Electron app to the AppleStore.

  1. https://www.electronjs.org/docs/latest/tutorial/mac-app-store-submission-guide

Actual behavior

I was trying to submit our Electron app to the Mac App Store and ran into a multitude of issues. At the very least, I was hoping that the official guide would work (https://www.electronjs.org/docs/latest/tutorial/mac-app-store-submission-guide) but found it slightly a little incomplete.

The guide talks about building a MAS version of the app, which you can do using Electron Forge or Electron Builder, but Transporter requires a .pkg file. I was able to get a MAS app packaged as a .pkg using Electron Forge's @electron-forge/maker-pkg maker and this command: electron-forge make --targets='@electron-forge/maker-pkg' --platform=mas. Transporter found several problems when submitting.

  1. “Missing required icon”;
  2. “App sandbox not enabled”;
  3. “CFBundleIdentifier Collision:XXX is already in use by another application”;

Unfortunately, I spent more than 15 hours to reading all the official documents and the community, but still didn't find a proper solution.

Steps to reproduce

截屏2022-03-22 01 51 11 截屏2022-03-22 01 48 08 截屏2022-03-22 01 53 34

From Apple Transporter:

ERROR ITMS-90236: "Missing required icon. The application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image. For further assistance, see the Apple Human Interface Guidelines at https://developer.apple.com/macos/human-interface-guidelines/icons-and-images/app-icon"

ERROR ITMS-90296: "App sandbox not enabled. The following executables must include the "com.apple.security.app-sandbox" entitlement with a Boolean value of true in the entitlements property list: [( "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Helpers/chrome_crashpad_handler", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/morningplan Helper (GPU).app/Contents/MacOS/morningplan Helper (GPU)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/morningplan Helper (Plugin).app/Contents/MacOS/morningplan Helper (Plugin)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/morningplan Helper (Renderer).app/Contents/MacOS/morningplan Helper (Renderer)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Frameworks/morningplan Helper.app/Contents/MacOS/morningplan Helper", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/MacOS/morningplan", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Helpers/chrome_crashpad_handler", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (GPU).app/Contents/MacOS/Electron Helper (GPU)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/Electron Helper (Plugin)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app/Contents/MacOS/Electron Helper (Renderer)", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Squirrel.framework/Versions/A/Resources/ShipIt", "com.arthurslog.morningplan.pkg/Payload/morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/MacOS/Electron" )] Refer to App Sandbox page at https://developer.apple.com/documentation/security/app_sandbox for more information on sandboxing your app."

ERROR ITMS-90511: "CFBundleIdentifier Collision. The Info.plist CFBundleIdentifier value 'com.github.Electron' of 'morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app' is already in use by another application."

ERROR ITMS-90511: "CFBundleIdentifier Collision. The Info.plist CFBundleIdentifier value 'com.github.Electron.helper' of 'morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (GPU).app' is already in use by another application."

ERROR ITMS-90511: "CFBundleIdentifier Collision. The Info.plist CFBundleIdentifier value 'com.github.Electron.helper' of 'morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app' is already in use by another application."

ERROR ITMS-90511: "CFBundleIdentifier Collision. The Info.plist CFBundleIdentifier value 'com.github.Electron.helper' of 'morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper (Renderer).app' is already in use by another application."

ERROR ITMS-90511: "CFBundleIdentifier Collision. The Info.plist CFBundleIdentifier value 'com.github.Electron.helper' of 'morningplan.app/Contents/Resources/app/node_modules/.electron.DELETE/dist/Electron.app/Contents/Frameworks/Electron Helper.app' is already in use by another application."

Additional information

No response

ShongSu commented 1 year ago

try create a folder calledicon.iconset, and then apply sips and iconutil commands.

erickzhao commented 1 year ago

Hey @BlessedChild. For your icon error:

ERROR ITMS-90236: The application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image.

You don't seem to have a @2x icon file in the icon path. In order to make this work, you would want to exclude your icon extension.

See: https://www.electronforge.io/guides/create-and-add-icons#supporting-higher-pixel-densities


Aside 1: Not sure why your config is duplicated between the PKG maker and the Packager config.

Aside 2: there was a breaking change of the macOS code signing library in Forge v6.0.0-beta.68 that changes a bunch of configuration options. It also comes with defaults that should work out of the box. This might solve your other issues if your info.plist isn't working.