bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.14k stars 3.45k forks source link

I encountered an error when I tried to build Android development #8619

Open an1217 opened 1 year ago

an1217 commented 1 year ago

thread 'main' panicked at 'Failed to read source.properties: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/anmingle/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/ndk-build-0.9.0/src/ndk.rs:89:14 Here is my running environment: Android Debug Bridge version 1.0.41 Version 28.0.2-debian Installed as /usr/lib/android-sdk/platform-tools/adb NDK:--version 21.4.7075529 The system is ubuntu

mockersf commented 1 year ago

Is this when building or when running? Could you share the commands you executed? Could you share code to reproduce the issue?

an1217 commented 1 year ago

Running, I follow the tutorial on the official website and [Download command] sudo apt install android-sdk android-tools-adb android-tools-fastboot [environment variable] export ANDROID_SDK_ROOT=/home/anmingle/Android/Sdk export ANDROID_NDK_ROOT=/home/anmingle/Android/Sdk/21.4.7075529

Sorry for the following error when I tried to retry: Android SDK has no platforms installed. I've been trying for a long time

an1217 commented 1 year ago

The ndk version 25.2.9519653 sdk version 31 I used cannot run. Is there any documentation for the version I can use

mockersf commented 1 year ago

Works for me with both ndk 25.2.9519653 and 24.0.8215888. The errors would point more at something in your setup...

an1217 commented 1 year ago

Works for me with both ndk 25.2.9519653 and 24.0.8215888. The errors would point more at something in your setup... After I reset the environment, the following error appears. I have no way to solve it: ld: error: undefined symbol: getifaddrs

referenced by network_helper_nix.rs:108 (src/network_helper_nix.rs:108) sysinfo-e87a282ac6bee898.sysinfo.ed36b560-cgu.14.rcgu.o:(sysinfo::network_helper_nix::get_interface_address::h3f7e40636380f86f) in archive D:\bevy\andor\tar get\aarch64-linux-android\debug\deps\libsysinfo-e87a282ac6bee898.rlib clang: error: linker command failed with exit code 1 (use -v to see invocation)

paul-hansen commented 1 year ago

Running, I follow the tutorial on the official website and [Download command] sudo apt install android-sdk android-tools-adb android-tools-fastboot [environment variable] export ANDROID_SDK_ROOT=/home/anmingle/Android/Sdk export ANDROID_NDK_ROOT=/home/anmingle/Android/Sdk/21.4.7075529

Sorry for the following error when I tried to retry: Android SDK has no platforms installed. I've been trying for a long time

It looks like your ANDROID_NDK_ROOT variable is missing the /ndk directory.

- ANDROID_NDK_ROOT=/home/anmingle/Android/Sdk/21.4.7075529
+ ANDROID_NDK_ROOT=/home/anmingle/Android/Sdk/ndk/21.4.7075529