tauri-apps / tauri

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

[feat] v2: Frameworks aren't being picked up for iOS builds #9962

Open stijnfrishert opened 3 weeks ago

stijnfrishert commented 3 weeks ago

Describe the bug

I'm using a Rust crate that depends on coreaudio-rs. For this work work on macOS/iOS, I need to link against the CoreAudio framework.

I'm building for iOS (using the v2 beta) and the linker tells me it's missing core audio symbols.

I've tried setting bundle > iOS > frameworks to [ "CoreAudio" ] in tauri.conf.json, but I get an error that the "frameworks" property is not allowed.

I've also tried setting the same on bundle > macOS > frameworks, but that doesn't help. Neither do I see --framework CoreAudio show up in the linker command.

Expected behavior

I would expect bundle > iOS > framework to be valid and insert the frameworks into the linker command

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.5.0 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.2
    - pnpm: 9.1.2
    - npm: 10.5.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.20
    - tauri-build [RUST]: 2.0.0-beta.16
    - wry [RUST]: 0.40.0
    - tao [RUST]: 0.28.0
    - tauri-cli [RUST]: 2.0.0-beta.17
    - @tauri-apps/api [NPM]: 2.0.0-beta.12
    - @tauri-apps/cli [NPM]: 2.0.0-beta.18

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

@FabianLars I'm yet unfamiliar with the Tauri internals, but if you could point me in the right direction I'm willing to try my hand at a PR :)

pewsheen commented 3 weeks ago

I haven't tried it on the release build, but for the dev build, I think the easiest way to embed the framework now is using pnpm tauri ios open to open the project in Xcode and add the framework from it.

stijnfrishert commented 3 weeks ago

Thanks, @pewsheen, didn't know that was possible, so I learned something. 😄

Decided to go the PR route and learn something about Tauri's internals. Hopefully someone will pick up the PR soon and help me with some remaining questions. :)