Closed lok52 closed 1 year ago
Can you make a reproduction repo? I'm not quite sure what's going on here.
I followed the official guide using create-tauri-app
with default template. You can reproduce these commands locally:
projects > yarn create tauri-app --alpha
yarn create v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Installed "create-tauri-app@3.2.1" with binaries:
- create-tauri-app
✔ Project name · tauri-test
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm)
✔ Choose your package manager · yarn
✔ Choose your UI template · Svelte - (https://svelte.dev/)
✔ Choose your UI flavor · TypeScript
✔ Would you like to setup the project for mobile as well? · yes
Template created! To get started run:
cd tauri-test
yarn
yarn tauri android init
yarn tauri ios init
For Desktop development, run:
yarn tauri dev
For Android development, run:
yarn tauri android dev
For iOS development, run:
yarn tauri ios dev
✨ Done in 19.74s.
Then just:
cd tauri-test
yarn
yarn tauri ios init
yarn tauri ios dev
And the error appears
It works fine for me - probably because my Rust target is aarch64-apple-ios-sim
. Gonna talk about this with the Tauri team.
Did you use a machine with M1 chip?
Yeah M1 pro
Looks like I found the problem.
The following command invoked by swift-rs
produced the error:
ios-api > swift build -c debug --scratch-path /Users/leonidtyurin/projects/tauri-test/src-tauri/target/x86_64-apple-ios/debug/build/tauri-b8a991d93d8a93f2/out/swift-rs/Tauri -Xswiftc -sdk -Xswiftc /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk -Xswiftc -target -Xswiftc x86_64-apple-ios16.0
Building for debugging...
<unknown>:0: error: unable to load standard library for target 'x86_64-apple-ios16.0-simulator'
<unknown>:0: error: unable to load standard library for target 'x86_64-apple-ios16.0-simulator'
But, if I change sdk
path variable (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.2.sdk
-> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk
) everything works fine:
ios-api > swift build -c debug --scratch-path /Users/leonidtyurin/projects/tauri-test/src-tauri/target/x86_64-apple-ios/debug/build/tauri-b8a991d93d8a93f2/out/swift-rs/Tauri -Xswiftc -sdk -Xswiftc /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -Xswiftc -target -Xswiftc x86_64-apple-ios16.0
Building for debugging...
[11/11] Archiving libTauri.a
Build complete! (8.52s)
So, I guess problem is somewhere here in the build.rs
file.
So, it incorrectly infers SDK path for simulator
I think this PR fixes the issue, but the Tauri does not include it, yet :)
Looks like this is rectified over on Tauri's end :)
When building a Tauri project I get the following error:
Versions:
Looks like something is wrong with environment setup and probably completely related to Tauri itself. But, maybe someone knows how to solve it?