tauri-apps/tauri

[bug] error[E0463]: can't find crate for `core` when trying to build for iOS and Android

Closed this issue · 2 comments

Describe the bug

After initializing the iOS app with yarn tauri ios init, I've opened the project in Xcode and set the developer group.
then when I try to run the app on my iPad with:

yarn run v1.22.22
$ tauri ios dev --host
Detected connected device: Aykut Kilic’s iPad (iPad14,5) with target "aarch64-apple-ios"
    Info Using 192.168.1.110 to access the development server.
...
$ tauri ios xcode-script -v --platform iOS --sdk-root /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.2.sdk --framework-search-paths '/Users/aykutkilic/Library/Developer/Xcode/DerivedData/tauro-feiprdrnqpgyqleetvvptlgvlwgr/Build/Products/debug-iphoneos  "."' --header-search-paths '/Users/aykutkilic/Library/Developer/Xcode/DerivedData/tauro-feiprdrnqpgyqleetvvptlgvlwgr/Build/Products/debug-iphoneos/include ' --gcc-preprocessor-definitions ' DEBUG=1' --configuration debug arm64
   Compiling libc v0.2.169
   Compiling serde v1.0.216
   Compiling smallvec v1.13.2
   Compiling stable_deref_trait v1.2.0
   Compiling ident_case v1.0.1
   Compiling strsim v0.11.1
   Compiling hashbrown v0.15.2
   Compiling icu_provider v1.5.0
error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-apple-ios` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-ios`

I get the error above.

For android I get the following error:

$ vite

  VITE v6.0.5  ready in 99 ms

  ➜  Network: http://192.168.1.110:1420/
   Compiling serde v1.0.216
   Compiling libc v0.2.169
   Compiling stable_deref_trait v1.2.0
   Compiling smallvec v1.13.2
   Compiling icu_locid_transform v1.5.0
   Compiling icu_collections v1.5.0
   Compiling zerofrom v0.1.5
   Compiling thiserror v2.0.8
error[E0463]: can't find crate for `std`
  |
  = note: the `aarch64-linux-android` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-linux-android`

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-linux-android` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-linux-android`

error: could not compile `libc` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `stable_deref_trait` (lib) due to 1 previous error
error: could not compile `smallvec` (lib) due to 1 previous error
error: could not compile `zerofrom` (lib) due to 1 previous error
error: could not compile `serde` (lib) due to 1 previous error
`Failed to run `cargo build`: command ["cargo", "build", "--package", "tauro", "--manifest-path", "/Users/aykutkilic/git/tauro/src-tauri/Cargo.toml", "--target", "aarch64-linux-android", "--lib"] exited with code 101
    Error `Failed to run `cargo build`: command ["cargo", "build", "--package", "tauro", "--manifest-path", "/Users/aykutkilic/git/tauro/src-tauri/Cargo.toml", "--target", "aarch64-linux-android", "--lib"] 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.

Reproduction

init app
init iOS app
init android app

open in Xcode
set the dev group
try to build.

for android yarn tauri android dev --host

Expected behavior

the build should succeed.

Full tauri info output

Here's my tauri info. I have an M3 Mac with Sequoia 15.3, the target is an M2 iPad Pro.

(base) aykutkilic@192 tauro % yarn tauri info              
yarn run v1.22.22
$ tauri info

[✔] Environment
    - OS: Mac OS 15.3.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.79.0 (129f3b996 2024-06-10) (Homebrew)
    ✔ cargo: 1.79.0
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 22.12.0
    - yarn: 1.22.22
    - npm: 10.9.0

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

[-] Plugins

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

[-] iOS
    - Developer Teams: Aykut Kilic

Stack trace

No response

Additional context

No response

out.log
I've added the output of the build.

https://stackoverflow.com/a/77852953/480478
uninstalling rust and reinstalling (without using brew) fixed my case.