-
Notifications
You must be signed in to change notification settings - Fork 54
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
Disable ndk
default features to remove raw-window-handle 0.6
#142
Disable ndk
default features to remove raw-window-handle 0.6
#142
Conversation
This error is triggered based on compile target, how should disabling features have an effect? |
To be honest I don't know exactly how to test this crate (android-activity), I don't think my change is the root cause of my error, but rather something on my end, I just quickly got the PR running to start the discussion because I'm curious on how to address the issue. I'm not sure how to answer your question, I guess I expected cargo test to select the correct target if only one were available, so I was surprised and unsure how to proceed. |
@Vrixyz right, the way the description is set up (no context what you want to achieve, only something about an error) made me think this PR tried to address the error in the screenshot. Rather, you meant that that error shows up making you unable to test. Please solve that by providing a commit message and PR description detailing what you want to achieve, because I'd approve the code changes in a pinch. |
In that case I've done you a solid and wrote a sensible description for you. Note that it was my decision to have There's likely no need to re-expose |
The `ndk` crate enables `raw-window-handle 0.6` by default (because of rust-mobile/ndk#434 (comment)) which might not be used by consumers of the `android-activity` crate at all, or might (still) be a mismatching version. Even if the `rwh_0x` features are additive, figuring that out leads to cryptic errors and it is best to turn off these defaults completely and leave it to the user to turn it back on in their own `[dependencies]` section if desired.
8caa2d9
to
77fb275
Compare
Thanks! I edited the commit to reflect that, but I guess you can also squash and edit it from github UI, let me know if I can be of assistance further. |
Hey thanks for poking at this @Vrixyz That error was essentially Cargo saying that the Cargo lets you cross compile crates for other platforms by passing a
but more generally for Rust Android development you also need to have downloaded the latest Android NDK from https://developer.android.com/ndk/downloads?authuser=3 and have pointed the I tend to use the E.g. something like: cargo install cargo-ndk
export ANDROID_NDK_ROOT=/path/to/ndk-r26
cargo ndk build --features=native-activity Currently though we don't have any tests for this crate besides testing various apps or examples like these: https://github.com/rust-mobile/rust-android-examples
There are also some examples in this repo that each have a README that shows how they can be built and installed. |
ndk
default features to remove raw-window-handle 0.6
@Vrixyz thanks! I've gone ahead and squash-merged this while doing some patching (in particular, putting a title back into the commit message). |
Although this crate has some examples that depend on the ndk, they aren't regular Cargo examples, they are completely standalone apps that depend on dev-dependencies.
Fixes #141
The
ndk
crate enablesraw-window-handle 0.6
by default (because of rust-mobile/ndk#434 (comment)) which might not be used by consumers of theandroid-activity
crate at all, or might (still) be a mismatching version. Even if therwh_0x
features are additive, figuring that out leads to cryptic errors and it is best to turn off these defaults completely and leave it to the user to turn it back on in their own[dependencies]
section if desired.I couldn't run the test because of that error, I'm on mac, not sure how my android dev setup is right now 😅