tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
82.69k stars 2.48k forks source link

[bug] failed to bundle project: failed to upload app to Apple's notarization servers. #7665

Open ruoxiaomo opened 1 year ago

ruoxiaomo commented 1 year ago

Describe the bug

yarn tauri build --target aarch64-apple-darwin

...

Finished release [optimized] target(s) in 13.71s
    Bundling XXX.app (/Users/xxx/xxx/vue_tauri/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/XXX.app)
     Signing /Users/xxx/xxx/vue_tauri/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/XXX.app with identity "Developer ID Application: XXX (xxxxxxxx)"
     Signing /var/folders/52/_68vs2g11qnd3y65qz65mw6c0000gn/T/.tmpCw7kuJ/XXX.zip with identity "Developer ID Application:  XXX (xxxxxxxx)"
  Notarizing /Users/xxx/xxx/vue_tauri/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/XXX.app
       Error failed to bundle project: failed to upload app to Apple's notarization servers.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I followed https://tauri.app/v1/guides/distribution/sign-macos/#signing-tauri-apps to create relevant certificates and Apple account passwords, APPLE_CERTIFICATE, APPLE_CERTIFICATE_PASSWORD and set signingIdentity, but Error still appears on mac mini M2 failed to bundle project: failed to upload app to Apple's notarization servers. error, how to fix it? Or where is the log?

And is it affected by https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool?

by the way, my certificate type is Developer ID Application

Reproduction

No response

Expected behavior

No response

Platform and versions

yarn run v1.22.19
$ tauri info

[✔] Environment
    - OS: Mac OS 13.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.71.1 (eb26296b5 2023-08-03)
    ✔ Cargo: 1.71.1 (7f1d04c00 2023-07-29)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.17.0
    - yarn: 1.22.19
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: default-src 'self'; img-src 'self' asset: *; script-src 'self' asset: https://asset.localhost; style-src 'unsafe-inline'  asset: *; media-src *;
    - distDir: ../dist
    - devPath: http://localhost:5173/
    - framework: Vue.js
    - bundler: Vite
✨  Done in 4.70s.

Stack trace

No response

Additional context

No response

FabianLars commented 1 year ago

Can you try it again with the --verbose flag please? Just to see if it has any more details :)

ruoxiaomo commented 1 year ago

Can you try it again with the --verbose flag please? Just to see if it has any more details :)

thank you very much🙏, The error is solved, Now: Command xcrun altool --notarization-info xxx-xxx-xxx-xxx-xxx -u xxxx@xx.com -p xxx-xxx-xxx-xxx 2023-08-22 11:34:06.556 *** Warning: altool has been deprecated for notarization and starting in late 2023 will no longer be supported by the Apple notary service. You should start using notarytool to notarize your software. (-1030) No errors getting notarization info.

       Date: 2023-08-22 02:46:20 +0000
       Hash: xxxxxxxxxxxxxxxxxxxxxx
RequestUUID: xxxxxxxxxxxxxxxxx
     Status: in progress

what next? why status always in progress?

ruoxiaomo commented 1 year ago

Can you try it again with the --verbose flag please? Just to see if it has any more details :)

thank you very much🙏, The error is solved, Now: Command xcrun altool --notarization-info xxx-xxx-xxx-xxx-xxx -u xxxx@xx.com -p xxx-xxx-xxx-xxx 2023-08-22 11:34:06.556 *** Warning: altool has been deprecated for notarization and starting in late 2023 will no longer be supported by the Apple notary service. You should start using notarytool to notarize your software. (-1030) No errors getting notarization info.

       Date: 2023-08-22 02:46:20 +0000
       Hash: xxxxxxxxxxxxxxxxxxxxxx
RequestUUID: xxxxxxxxxxxxxxxxx
     Status: in progress

what next? why status always in progress?

@FabianLars

agnelnieves commented 1 year ago

Following, had the the same issue over the weekend. In this case @ruoxiaomo, you're notarizing locally. Any issues using the tauri app workflow? I've seen the following error Error failed to bundle project: failed to upload app to Apple's notarization servers. At first i thought it was the credentials but they're correct. Now saw your comment about the notarization service deprecation. Wondering if this affects the GitHub Action workflow provided by tauri on tauri-apps/tauri-action@0

Error

image

Info

image

R2rog commented 1 year ago

@agnelnieves The same error appears to me when running the Tauri Github Action.

Captura de pantalla 2023-09-05 a la(s) 11 13 32
PeterBlenessy commented 1 year ago

If it has worked before, you may just need to accept an updated version of some agreements in the Apple developer portal.

ogtfaber commented 1 year ago

It's also possible you need to supply your team ID through APPLE_PROVIDER_SHORT_NAME

tance77 commented 1 year ago

If it has worked before, you may just need to accept an updated version of some agreements in the Apple developer portal.

Can't say how many times I run into this issue but this usually is why it fails.

Make sure you log into the Apple Developer Portal and accept their new terms of service.

R2rog commented 11 months ago

Hi already accepted the new Terms of service and added the APPLE_TEAM_ID secret to my repository but I still get the error. Here is my main.yml in case someone has any suggestion I would appreciate it: ` name: Release on: push: tags:

jobs: release: permissions: contents: write strategy: fail-fast: true matrix: platform: [macos-latest, ubuntu-20.04, windows-latest] runs-on: ${{ matrix.platform }}

steps:
  - name: Checkout repository
    uses: actions/checkout@v3

  - name: Install dependencies (ubuntu only)
    if: matrix.platform == 'ubuntu-20.04'
    # You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
    run: |
      sudo apt-get update
      sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
  - name: Rust setup
    uses: dtolnay/rust-toolchain@stable

  - name: Rust cache
    uses: swatinem/rust-cache@v2
    with:
      workspaces: './src-tauri -> target'

  - name: Sync node version and setup cache
    uses: actions/setup-node@v3
    with:
      node-version: 'lts/*'
      cache: 'npm' # Set this to npm, yarn or pnpm.

  - name: Install frontend dependencies
    # If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
    run: npm install # Change this to npm, yarn or pnpm.

  - name: Build the app
    uses: tauri-apps/tauri-action@v0

    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
      APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
      APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
      APPLE_ID: ${{ secrets.APPLE_ID }}
      APPLE_TEAM_ID: ${{secrets.APPLE_TEAM_ID}}
      APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
      TAURI_PRIVATE_KEY: ${{secrets.TAURI_PRIVATE_KEY}}
      TAURI_KEY_PASSWORD: ${{secrets.TAURI_KEY_PASSWORD}}
    with:
      tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
      releaseName: 'App v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
      releaseBody: 'Test release'
      releaseDraft: true
      prerelease: false`
R2rog commented 10 months ago

Hi already accepted the new Terms of service and added the APPLE_TEAM_ID secret to my repository but I still get the error. Here is my main.yml in case someone has any suggestion I would appreciate it: ` name: Release on: push: tags: - 'v*' workflow_dispatch:

jobs: release: permissions: contents: write strategy: fail-fast: true matrix: platform: [macos-latest, ubuntu-20.04, windows-latest] runs-on: ${{ matrix.platform }}

steps:
  - name: Checkout repository
    uses: actions/checkout@v3

  - name: Install dependencies (ubuntu only)
    if: matrix.platform == 'ubuntu-20.04'
    # You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
    run: |
      sudo apt-get update
      sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
  - name: Rust setup
    uses: dtolnay/rust-toolchain@stable

  - name: Rust cache
    uses: swatinem/rust-cache@v2
    with:
      workspaces: './src-tauri -> target'

  - name: Sync node version and setup cache
    uses: actions/setup-node@v3
    with:
      node-version: 'lts/*'
      cache: 'npm' # Set this to npm, yarn or pnpm.

  - name: Install frontend dependencies
    # If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
    run: npm install # Change this to npm, yarn or pnpm.

  - name: Build the app
    uses: tauri-apps/tauri-action@v0

    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
      APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
      APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
      APPLE_ID: ${{ secrets.APPLE_ID }}
      APPLE_TEAM_ID: ${{secrets.APPLE_TEAM_ID}}
      APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
      TAURI_PRIVATE_KEY: ${{secrets.TAURI_PRIVATE_KEY}}
      TAURI_KEY_PASSWORD: ${{secrets.TAURI_KEY_PASSWORD}}
    with:
      tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
      releaseName: 'App v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
      releaseBody: 'Test release'
      releaseDraft: true
      prerelease: false`

SOLUTION: Ok so for anyone struggling with this issue here's a list of things that worked for me: 1) As suggested above I went to my Apple developer account and accepted new terms and services. 2) Matched the APPLE_SIGNING_IDENTITY to the one in the certificate by using the terminal command: security find-identity -v -p codesigning 3) Replaced the APPLE_PASSWORD from my account password to an app specific password.
This three changes alongside the tips above made the notarization process finally work.

maxabrahamsson commented 10 months ago

For others struggling to find where they need to accept aforementioned agreement; Visit https://appstoreconnect.apple.com/

maxabrahamsson commented 10 months ago

This fails on my CI - MacBook (x86), both through the ci job action & when I manually try on same machine through terminal (tauri build). But same project / account / certificate succeeds on my dev MacBook (M1) without a problem. I created the certificate on the dev macbook and moved/imported to the CI machine.

I am still getting same error despite trying all the mentioned tips. What else could be causing this?