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

Building for iOS causes errors #95

Open
finnnnnnnnnnnnnnnnn opened this issue Dec 28, 2023 · 8 comments
Open

Building for iOS causes errors #95

finnnnnnnnnnnnnnnnn opened this issue Dec 28, 2023 · 8 comments

Comments

@finnnnnnnnnnnnnnnnn
Copy link

When attempting to use this template I get all these errors when building in Xcode.

cargo_ios
could not compile `cfg-if` (lib) due to 2 previous errors

could not compile `pin-project-lite` (lib) due to 9 previous errors

could not compile `bitflags` (lib) due to 3 previous errors

cannot find macro `panic` in this scope

could not compile `rustc-hash` (lib) due to 4 previous errors

cannot find attribute `derive` in this scope

could not compile `parking` (lib) due to 27 previous errors

could not compile `thiserror` (lib) due to 15 previous errors

cannot determine resolution for the macro `vec`

cannot find macro `assert_eq` in this scope

cannot find macro `write` in this scope

cannot find macro `assert` in this scope

could not compile `log` (lib) due to 92 previous errors

cannot find macro `assert_ne` in this scope

cannot find macro `debug_assert` in this scope

cannot determine resolution for the macro `ptr::addr_of`

cannot determine resolution for the macro `ptr::addr_of_mut`

cannot find macro `unreachable` in this scope

could not compile `futures-core` (lib) due to 75 previous errors

cannot find macro `debug_assert_ne` in this scope

cannot find macro `debug_assert_eq` in this scope

could not compile `libc` (lib) due to 3 previous errors

cannot find macro `matches` in this scope

could not compile `mint` (lib) due to 287 previous errors

could not compile `zerocopy` (lib) due to 341 previous errors

cannot find macro `concat` in this scope

could not compile `once_cell` (lib) due to 241 previous errors

could not compile `bytemuck` (lib) due to 459 previous errors

could not compile `ppv-lite86` (lib) due to 747 previous errors

cannot find macro `unimplemented` in this scope

cannot find attribute `test` in this scope

cannot find macro `format_args` in this scope

cannot find macro `stringify` in this scope

could not compile `memchr` (lib) due to 663 previous errors

could not compile `serde` (lib) due to 5115 previous errors

No clue what I've done wrong, I'm very new to Bevy and Rust in general.

@NiklasEi
Copy link
Owner

Did you follow the bevy example readme to install the rust targets for your phone/emulator?

@finnnnnnnnnnnnnnnnn
Copy link
Author

You mean this command?

rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim

I have run this

@NiklasEi
Copy link
Owner

Yes, that's what I meant.

Could you attach a complete log of a build please?

@finnnnnnnnnnnnnnnnn
Copy link
Author

Heres the log:
Build mobile_2024-01-02T11-35-54.txt
I get the same error when using the bash script as well

@NiklasEi
Copy link
Owner

NiklasEi commented Jan 3, 2024

error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-apple-ios` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-apple-ios`

error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-apple-ios` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-apple-ios`

Can you run rustup show in the same directory and check if it lists the ios target?

@finnnnnnnnnnnnnnnnn
Copy link
Author

Here's the result of rustup show:

rustup home:  /Users/user/.local/share/rustup

installed targets for active toolchain
--------------------------------------

aarch64-apple-ios
aarch64-apple-ios-sim
x86_64-apple-darwin
x86_64-apple-ios

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.73.0 (cc66ad468 2023-10-03)

I've just noticed that the error I'm seeing is

error[E0463]: can't find crate for `std`
  |
  = note: the `aarch64-apple-ios` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-ios`

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`

Which is different from the x86_64-apple-ios in the first log file, so now I'm really lost, though this difference could be since the first log is from building in Xcode and this is from running the make file?

I'm using an Intel Mac not Apple Silicon if thats important.

@NiklasEi
Copy link
Owner

NiklasEi commented Jan 6, 2024

I am honestly a bit stumped and can't check on a Mac myself at the moment. The release pipeline on GitHub for iOS is running fine on macOS, not sure what else I could test.

Maybe you could try running the rustc commands directly?

cargo rustc --crate-type staticlib --lib $RELFLAG --target x86_64-apple-ios

@NiklasEi
Copy link
Owner

NiklasEi commented Dec 2, 2024

@finnnnnnnnnnnnnnnnn Have you figured out what the issue was/is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants