Skip to content

[bug] Apple Notorization fails if bundle identifier have special chars like underscores _ #4359

@imadbz

Description

@imadbz

Describe the bug

If bundle identifier have a special character like underscore _, bundling for MacOS with code signing will fail without a clear reason.

Its not a big deal, but it might save another developer couple hours figuring it out.

ex:

{
    "$schema": "../node_modules/@tauri-apps/cli/schema.json",
   ...,
    "tauri": {
        ...,
        "bundle": {
            ...,
            "identifier": "com.tauri.tauri_app_example",
        },
}

it will output something like this:

  Notarizing /Users/.../src-tauri/target/universal-apple-darwin/release/bundle/macos/prodcutname.app

        Info notarization started; waiting for Apple response...

Error running CLI: failed to bundle project: Apple failed to notarize your app. No errors getting notarization info.

       Date: 2022-06-16 02:57:19 +0000
RequestUUID: xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx
     Status: invalid

: Apple failed to notarize your app. No errors getting notarization info.

       Date: 2022-06-16 02:57:19 +0000
RequestUUID: xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxx
     Status: invalid

Reproduction

  1. create a new tauri app with underscored identifier in the config
  2. setup code signing for mac
  3. run tauri build

Expected behavior

It will fail.

Platform and versions

Environment
  › OS: Mac OS 12.4.0 X64
  › Node.js: 16.15.0
  › npm: 8.10.0
  › pnpm: 6.11.0
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-aarch64-apple-darwin 

Packages
WARNING: no lock files found, defaulting to npm
  › @tauri-apps/cli [NPM]: 1.0.0-rc.13 (outdated, latest: 1.0.0)
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.0-rc.15,
  › tauri-build [RUST]: 1.0.0-rc.13,
  › tao [RUST]: 0.10.0,
  › wry [RUST]: 0.18.2,

App
  › build-type: bundle
  › CSP: unset

App directory structure
  ├─ dist
  └─ src-tauri

Additional context

proposed solutions:

either:

  1. auto remove special chars from identifier
    com.tauri.example_app -> com.tauri.exampleapp
  2. throw a warning during the build time that it might cause problems with Notorization
  3. do not allow identifiers with special chars

I would love to hear an expert input on this. Will push a fix when we settle on the right solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions