tauri-apps / tauri

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

[bug] tauri ios init fails on M1 mac #11244

Open szmarci opened 1 month ago

szmarci commented 1 month ago

Describe the bug

After installing prerequisites, running bun run tauri ios init, results in:

$ tauri ios init
    Warn No code signing certificates found. You must add one and set the certificate development team ID on the `bundle > iOS > developmentTeam` config value or the `APPLE_DEVELOPMENT_TEAM` environment variable. To list the available certificates, run `tauri info`.
    Info detected rustc version 1.81.0 (eeb90cda1 2024-9-4)
/usr/local/bin/xcodegen
    Info package `xcodegen` present: true
/opt/local/bin/idevicesyslog
    Info package `libimobiledevice` present: true
/usr/local/bin/pod
    Info package `cocoapods` present: true
failed to install Apple dependencies: Failed to check for outdated packages: No such file or directory (os error 2): No such file or directory (os error 2)
    Error failed to install Apple dependencies: Failed to check for outdated packages: No such file or directory (os error 2): No such file or directory (os error 2)
error: script "tauri" exited with code 1

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.0.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.18.2
    - pnpm: 9.6.0
    - npm: 9.8.1
    - bun: 1.1.29

[-] Packages
    - tauri 🦀: 2.0.0
    - tauri-build 🦀: No version detected
    - wry 🦀: No version detected
    - tao 🦀: No version detected
    - @tauri-apps/api : 2.0.1
    - @tauri-apps/cli : 2.0.1

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0
    - @tauri-apps/plugin-shell : 2.0.0

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

chrox commented 1 month ago

Just encountered this exact issue several times, you just need to rerun tauri ios init and wait the cocoapods package updating some Apple dependencies.

chrox commented 1 month ago

In case of any misconfigurations, please ensure that you follow the prerequisites for iOS.

szmarci commented 3 weeks ago

I did follow the guide, but every time I run tauri ios init, I get back the original error:

Info package `cocoapods` present: true
failed to install Apple dependencies: Failed to check for outdated packages: No such file or directory (os error 2): No such file or directory (os error 2)
    Error failed to install Apple dependencies: Failed to check for outdated packages: No such file or directory (os error 2): No such file or directory (os error 2)
error: script "tauri" exited with code 1

I'm not sure if it makes a difference but I don't have homebrew installed, I have cocoapods installed with sudo gem install cocoapods

nongyehong commented 2 weeks ago

Restarting your mac may resolve the issue