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] iOS build failed #9808

Closed
nashaofu opened this issue May 17, 2024 · 1 comment
Closed

[bug] iOS build failed #9808

nashaofu opened this issue May 17, 2024 · 1 comment
Labels
platform: iOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@nashaofu
Copy link

Describe the bug

run yarn tauri ios dev failed, build with libz-sys failed,Successfully execute cargo build --target x86_64-apple-ios

source code:

use libz_sys::{crc32, Bytef};

// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
    let r = unsafe {
        let s = Bytef::default();
        crc32(123, &s, 20)
    };
    format!("Hello, {}! You've been greeted from Rust! {}", name, r)
}

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_shell::init())
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

error:

Undefined symbols for architecture x86_64:
  "_crc32", referenced from:
      tauri_app_lib::greet::hf585d5308eed4533 in libtauri_app_lib.a[168](tauri_app_lib.4c50k32uc77deasj.rcgu.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Reproduction

  1. clone https://github.com/nashaofu/tauri-demo.git
  2. run yarn
  3. run yarn tauri ios dev

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.4.1 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.78.0 (9b00956e5 2024-04-29)
    ✔ cargo: 1.78.0 (54d8815d0 2024-03-26)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (default)
    - node: 20.12.0
    - yarn: 1.22.22
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.19
    - tauri-build [RUST]: 2.0.0-beta.15
    - wry [RUST]: 0.39.5
    - tao [RUST]: 0.28.0
    - @tauri-apps/api [NPM]: 2.0.0-beta.11
    - @tauri-apps/cli [NPM]: 2.0.0-beta.17

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

[-] iOS
    - Developer Teams: *** (ID: ***)

Stack trace

No response

Additional context

No response

@nashaofu nashaofu added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 17, 2024
@nashaofu
Copy link
Author

nashaofu commented May 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: iOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants