-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Android support #470
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
First update rust binaries:
Windows users need this for the
|
What is actually missing here still? |
It's mostly missing one or a few motivated users that drive this forward, in terms of:
That is not to say a single person has to do all of them. I gladly provide support, especially when it comes to gdext-specific things such as CI setup, Godot integration tests etc. But I don't see myself realistically having the capacity to implement this myself in the next months, there's also the WASM port which is actively being worked on, and lots of core features to be ironed out. |
Ok, I can at least give a rough description on how I made it work locally (Linux/Arch):
rustup target add aarch64-linux-android 2.5) Install cargo ndk cargo install cargo ndk
env ANDROID_NDK_HOME=/opt/android-ndk cargo ndk -t arm64-v8a build
env ANDROID_NDK_HOME=/opt/android-ndk cargo ndk -t arm64-v8a build --release NOTE: If you are on a different distro, or you installed the ndk through Android Studio, you'll need to change the path to point to your correct ndk!
keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12 Note: I'm not quite sure which package
In my case it looks like this: [configuration]
entry_symbol = "gdext_rust_init"
compatibility_minimum = 4.1
[libraries]
linux.debug.x86_64 = "res://../rust/target/debug/librust_project.so"
linux.release.x86_64 = "res://../rust/target/release/librust_project.so"
windows.debug.x86_64 = "res://../rust/target/debug/rust_project.dll"
windows.release.x86_64 = "res://../rust/target/release/rust_project.dll"
macos.debug = "res://../rust/target/debug/librust_project.dylib"
macos.release = "res://../rust/target/release/librust_project.dylib"
macos.debug.arm64 = "res://../rust/target/debug/librust_project.dylib"
macos.release.arm64 = "res://../rust/target/release/librust_project.dylib"
android.release.arm64 = "res://../rust/target/aarch64-linux-android/debug/librust_project.so"
android.debug.arm64 = "res://../rust/target/aarch64-linux-android/release/librust_project.so"
-> Top Bar
You should now be left with an apk file in the godot/build folder. Note that Android Emulators which use x86/64-Android will not work for executing this. - We didn't compile in the necessary targets. - Though I'm sure you could add them somehow. |
Step-by-step for building Android library on Mac Apple/Arm devicesI'm experimenting with how to get this working on Mac (ARM) computers, using Godot 4.2.1, I dont have it working yet, but here is the work in progress.
This feature flag makes your application non-thread safe. But bypasses a bug that is currently under investigation.
It is not clear to me why this is needed. The next step fails on Mac if you do not have these settings:
|
I can confirm I got it working on Android too, as @moberer described, using Ubuntu 22.04. I am not sure what
Also I got
The versions could be different. It worked fine after that 👌 |
Cargo-NDK is a helper tool supposed to make this easier. But you need to install it manually, before being able to use it. You can install it like that: cargo install cargo-ndk
Afterward, the command should work. But as you discovered, it is not really necessary and only a "helper" to make the commands a bit less annoying. |
I do not know what this field is or how to fix it. but it might just be the issue I am encountering. my app runs fine on my laptop, but when I run in android it is a black screen. could this be the cause? |
Unlikely, when I had a bad name, I think it manifested as an export error. |
Knowledge base for the Android port: what's missing, insights, obstacles, etc.
There's no active work going on at the moment, but we can already collect some infos.
Related Discord thread.
The text was updated successfully, but these errors were encountered: