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.35k stars 2.58k forks source link

[bug] tauri ios dev error #11764

Open AdamShi opened 11 hours ago

AdamShi commented 11 hours ago

Describe the bug

I installed tauri2.0beta a few months ago and it worked great. This week I wanted to try the official version of tauri2.0. I installed the latest rust language, then created a Demo with yarn create tauri-app command, then created an ios project with yarn tauri ios init, and added the developmentTeam configuration in tauri.conf.json as follows

"iOS": {
"minimumSystemVersion": "13.0",
"developmentTeam": "xxxxx"
}

But when I run yarn tauri ios dev, it reports an error, the log is as follows

   Compiling tauri-plugin-shell v2.0.2
   Compiling bitfunded v0.1.0 (/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri)
   Compiling tauri-macros v2.0.3
error: failed to run custom build command for `tauri v2.1.1`

Caused by:
  process didn't exit successfully: `/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/target/debug/build/tauri-5d479c0bbcafc4d9/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-check-cfg=cfg(custom_protocol)
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:dev=true
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rustc-cfg=mobile
  cargo:rustc-link-search=native=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
  cargo:rustc-link-search=native=/usr/lib/swift
  cargo:rustc-link-lib=clang_rt.iossim
  cargo:rustc-link-search=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin

  --- stderr
  Fetching https://github.com/Brendonovich/swift-rs from cache
  warning: 'swift-rs': skipping cache due to an error: Couldn’t fetch updates from remote repositories:
      fatal: cannot use bare repository '/Users/adam/Library/Caches/org.swift.swiftpm/repositories/swift-rs-16819c90' (safe.bareRepository is 'explicit')
  [1/1072] Fetching swift-rs
  Fetched https://github.com/Brendonovich/swift-rs from cache (2.24s)
  error: Couldn’t get the list of tags:
      fatal: cannot use bare repository '/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/target/x86_64-apple-ios/debug/build/tauri-30986d7085224016/out/swift-rs/Tauri/repositories/swift-rs-16819c90' (safe.bareRepository is 'explicit')
  thread 'main' panicked at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.7/src-rs/build.rs:281:17:
  Failed to compile swift package Tauri
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
     1: core::panicking::panic_fmt
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
     2: swift_rs::build::SwiftLinker::link
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.7/src-rs/build.rs:281:17
     3: tauri_utils::build::link_swift_library
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-utils-2.1.0/src/build.rs:25:3
     4: tauri_utils::build::link_apple_library
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-utils-2.1.0/src/build.rs:11:5
     5: build_script_build::main
               at ./build.rs:323:7
     6: core::ops::function::FnOnce::call_once
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:250:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Failed to run `cargo build`: command ["cargo", "build", "--package", "bitfunded", "--manifest-path", "/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/Cargo.toml", "--target", "x86_64-apple-ios", "--features", "tauri/rustls-tls", "--lib", "--no-default-features"] exited with code 101
    Error Failed to run `cargo build`: command ["cargo", "build", "--package", "bitfunded", "--manifest-path", "/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/Cargo.toml", "--target", "x86_64-apple-ios", "--features", "tauri/rustls-tls", "--lib", "--no-default-features"] exited with code 101
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'bitfunded_iOS' from project 'bitfunded')
** BUILD FAILED **

The following build commands failed:
        PhaseScriptExecution Build\ Rust\ Code /Users/adam/Library/Developer/Xcode/DerivedData/bitfunded-etpzsrmfwcqiogavjyjdtpuvzkqo/Build/Intermediates.noindex/bitfunded.build/debug-iphonesimulator/bitfunded_iOS.build/Script-D61F0C1E9C49FED7F014D3FF.sh (in target 'bitfunded_iOS' from project 'bitfunded')
        Building workspace bitfunded with scheme bitfunded_iOS and configuration debug
(2 failures)
command ["xcodebuild"] exited with code 65
    Error command ["xcodebuild"] exited with code 65
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

No response

Expected behavior

Run the tauri project normally on the iOS simulator

Full tauri info output

yarn run v1.22.19
$ tauri info

[✔] Environment
    - OS: Mac OS 15.1.0 x86_64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.82.0 (f6e511eec 2024-10-15)
    ✔ cargo: 1.82.0 (8f40fc59f 2024-08-21)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 20.11.1
    - pnpm: 9.0.1
    - yarn: 1.22.19
    - npm: 10.2.4

[-] Packages
    - tauri 🦀: 2.1.1
    - tauri-build 🦀: 2.0.3
    - wry 🦀: 0.47.0
    - tao 🦀: 0.30.8
    - @tauri-apps/api : 2.1.1
    - @tauri-apps/cli : 2.1.0

Stack trace

   Compiling tauri-plugin-shell v2.0.2
   Compiling bitfunded v0.1.0 (/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri)
   Compiling tauri-macros v2.0.3
error: failed to run custom build command for `tauri v2.1.1`

Caused by:
  process didn't exit successfully: `/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/target/debug/build/tauri-5d479c0bbcafc4d9/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-check-cfg=cfg(custom_protocol)
  cargo:rustc-check-cfg=cfg(dev)
  cargo:rustc-cfg=dev
  cargo:dev=true
  cargo:rustc-check-cfg=cfg(desktop)
  cargo:rustc-check-cfg=cfg(mobile)
  cargo:rustc-cfg=mobile
  cargo:rustc-link-search=native=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
  cargo:rustc-link-search=native=/usr/lib/swift
  cargo:rustc-link-lib=clang_rt.iossim
  cargo:rustc-link-search=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/lib/darwin

  --- stderr
  Fetching https://github.com/Brendonovich/swift-rs from cache
  warning: 'swift-rs': skipping cache due to an error: Couldn’t fetch updates from remote repositories:
      fatal: cannot use bare repository '/Users/adam/Library/Caches/org.swift.swiftpm/repositories/swift-rs-16819c90' (safe.bareRepository is 'explicit')
  [1/1072] Fetching swift-rs
  Fetched https://github.com/Brendonovich/swift-rs from cache (2.24s)
  error: Couldn’t get the list of tags:
      fatal: cannot use bare repository '/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/target/x86_64-apple-ios/debug/build/tauri-30986d7085224016/out/swift-rs/Tauri/repositories/swift-rs-16819c90' (safe.bareRepository is 'explicit')
  thread 'main' panicked at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.7/src-rs/build.rs:281:17:
  Failed to compile swift package Tauri
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
     1: core::panicking::panic_fmt
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
     2: swift_rs::build::SwiftLinker::link
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swift-rs-1.0.7/src-rs/build.rs:281:17
     3: tauri_utils::build::link_swift_library
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-utils-2.1.0/src/build.rs:25:3
     4: tauri_utils::build::link_apple_library
               at /Users/adam/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tauri-utils-2.1.0/src/build.rs:11:5
     5: build_script_build::main
               at ./build.rs:323:7
     6: core::ops::function::FnOnce::call_once
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:250:5
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Failed to run `cargo build`: command ["cargo", "build", "--package", "bitfunded", "--manifest-path", "/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/Cargo.toml", "--target", "x86_64-apple-ios", "--features", "tauri/rustls-tls", "--lib", "--no-default-features"] exited with code 101
    Error Failed to run `cargo build`: command ["cargo", "build", "--package", "bitfunded", "--manifest-path", "/Users/adam/Desktop/TauriV2OfficialDemo/Bitfunded/src-tauri/Cargo.toml", "--target", "x86_64-apple-ios", "--features", "tauri/rustls-tls", "--lib", "--no-default-features"] exited with code 101
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'bitfunded_iOS' from project 'bitfunded')
** BUILD FAILED **

The following build commands failed:
        PhaseScriptExecution Build\ Rust\ Code /Users/adam/Library/Developer/Xcode/DerivedData/bitfunded-etpzsrmfwcqiogavjyjdtpuvzkqo/Build/Intermediates.noindex/bitfunded.build/debug-iphonesimulator/bitfunded_iOS.build/Script-D61F0C1E9C49FED7F014D3FF.sh (in target 'bitfunded_iOS' from project 'bitfunded')
        Building workspace bitfunded with scheme bitfunded_iOS and configuration debug
(2 failures)
command ["xcodebuild"] exited with code 65
    Error command ["xcodebuild"] exited with code 65
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional context

My development environment is MacBook Pro, Intel chip, MacOS15.1 Xcode version 16.1

FabianLars commented 9 hours ago

Do you maybe have a system proxy set up that could block requests to github urls?