Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] tauri ios dev error #11764

Open
AdamShi opened this issue Nov 21, 2024 · 4 comments
Open

[bug] tauri ios dev error #11764

AdamShi opened this issue Nov 21, 2024 · 4 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug

Comments

@AdamShi
Copy link

AdamShi commented Nov 21, 2024

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

@AdamShi AdamShi added status: needs triage This issue needs to triage, applied to new issues type: bug labels Nov 21, 2024
@FabianLars
Copy link
Member

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

@AdamShi
Copy link
Author

AdamShi commented Nov 22, 2024

@FabianLars No, I just turned on the company VPN, it does not block the github url, on the contrary, it accelerates the github link, it should not be the problem

@AdamShi
Copy link
Author

AdamShi commented Nov 22, 2024

@FabianLars I asked my colleague to help me do an experiment and found that if the latest version of rust is not upgraded, the Tauri2.0 official version of the Demo can run normally; but after upgrading to the latest version of rust, this error will be reported. From this point of view, it seems that the latest version of rust causes this problem

@FabianLars
Copy link
Member

hmm that's weird. latest rust works fine for me and the only difference i see is that i am on an arm macbook. but then i know that there are many intel users here and nobody else reported this yet 🤔

i'll mark this as upstream for now and let's see what the next rust version does...

@FabianLars FabianLars added status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes platform: macOS labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues status: upstream This issue is blocked by upstream dependencies and we need to wait or contribute upstream fixes type: bug
Projects
None yet
Development

No branches or pull requests

2 participants