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

Traverse Research Android tracking issues #4

Open
Jasper-Bekkers opened this issue Feb 26, 2022 · 3 comments
Open

Traverse Research Android tracking issues #4

Jasper-Bekkers opened this issue Feb 26, 2022 · 3 comments

Comments

@Jasper-Bekkers
Copy link
Member

Jasper-Bekkers commented Feb 26, 2022

At the moment setting up an android build from Rust / cargo is a bit of a pain. There's a lot of manual setup involved and there are fundamental limitations to some of the core rust tools that would need to be addressed. To address some of these issues we've tried to make some steps ourselves;

  • android-sdkmanager-rs We created an easy way to set up the android toolchain
  • android-ndk-rs We've made heavy contributions to android-ndk-rs to help improve and evolve it and make it nicer to use

Next steps

However, to take some of the next steps it would be nice to see progress from the cargo core team to make it able to build and run apks directly from cargo instead of requiring intermediate tooling.

Ideally I would love to see the rust workflow for building and running android applications to be as simple as:

cargo build --target ... --target ...
cargo run --device ??
@dvc94ch
Copy link

dvc94ch commented Mar 4, 2022

I'd like to point out an alternative approach. Recently I've been working on a replacement for cargo-apk called x. It's a build tool for building rust and rust/flutter applications for all platforms and publishing to the play/microsoft/app stores. It can currently download prepackaged macos/ios/windows sdks and can cross compile debug builds. Would really like to foster some collaboration, but it's still early days and will take a few more weeks until it starts being useful.

@MarijnS95
Copy link
Member

@dvc94ch It'd be great to have a solution that deals with with all platforms at once, but our end goal is to have it baked into cargo as a cross-ecosystem solution.

How does x relate to cargo-mobile?

@dvc94ch
Copy link

dvc94ch commented Mar 4, 2022

cargo-mobile is similar to flutter, they integrate into existing build systems. this is in my opinion a pain point as you need to configure 5 different build systems if you're building a cross platform application, and platform features need to be exposed in kotlin/swift/c++. Another pain point is that you actually need a mac to build an ios app with cargo-mobile, something that x still requires to generate certificates and provisioning profiles, but the end goal is being a cross platform system.

I think there is a lot of stuff here that will be tricky to integrate into cargo, because it's likely out of scope of what cargo does and possibly should do. In any case if cargo does gain more abilities more work can be offloaded to cargo. but I expect x to be a great testing ground for this purpose. For example I think the sdk-manager you built would be a nice fit to simplify the setup process on android for x, but I don't think it will ever become a part of cargo.

I'm not particularly attached to flutter in the long run, but for non-game apps I think it will be the most expedient short term solution. Rust can be used to build cross platform abstractions that can easily be integrated in dart using something like ffi-gen. But I know you have more of a game centric focus.

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

3 participants