Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Issues with cargo-apk + winit 0.19.0 #264

Open
VZout opened this issue Apr 30, 2020 · 6 comments
Open

Issues with cargo-apk + winit 0.19.0 #264

VZout opened this issue Apr 30, 2020 · 6 comments

Comments

@VZout
Copy link

VZout commented Apr 30, 2020

I'm trying to use cargo-apk with winit 0.19.0.

Sadly when I run cargo apk build --target ... I get the following error:

= note: /root/src/target/aarch64-linux-android/debug/deps/winittest-5ef4fa9e35ece31e.56g2qny4080fqnx9.rcgu.o: In function `android_glue::get_native_window::h9f6ad735a1f5e276':
          /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.3/src/lib.rs:123: undefined reference to `cargo_apk_injected_glue_get_native_window'
          /root/src/target/aarch64-linux-android/debug/deps/libwinit-cb9bde4e4aad5599.rlib(winit-cb9bde4e4aad5599.winit.3jes6306-cgu.7.rcgu.o): In function `android_glue::add_sender::h7785d30e730c9e30':
          /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.3/src/lib.rs:77: undefined reference to `cargo_apk_injected_glue_add_sender'
          /root/src/target/aarch64-linux-android/debug/deps/libwinit-cb9bde4e4aad5599.rlib(winit-cb9bde4e4aad5599.winit.3jes6306-cgu.7.rcgu.o): In function `android_glue::set_multitouch::h6397524dfc3a3cc3':
          /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.3/src/lib.rs:102: undefined reference to `cargo_apk_injected_glue_set_multitouch'
          /root/src/target/aarch64-linux-android/debug/deps/libwinit-cb9bde4e4aad5599.rlib(winit-cb9bde4e4aad5599.winit.3jes6306-cgu.7.rcgu.o): In function `android_glue::get_native_window::h0c5643fa0d486f75':
          /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/android_glue-0.2.3/src/lib.rs:123: undefined reference to `cargo_apk_injected_glue_get_native_window'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

What causes this issue? Is it because winit is a dependency and I don't use android_glue directly?

@dvc94ch
Copy link
Contributor

dvc94ch commented Apr 30, 2020

The only way it works currently is with goddessfreya/winit#2. The current cargo-apk implementation is in https://github.com/rust-windowing/android-ndk-rs

@VZout VZout changed the title cargo-apk + winit 0.19.0 Issues with cargo-apk + winit 0.19.0 Apr 30, 2020
@VZout
Copy link
Author

VZout commented Apr 30, 2020

Thanks for your reply. I'm slightly confused. Will android-glue be completely deprecated in favor of android-ndk-rs? What is exactly the difference between glue and android-ndk-rs?

@dvc94ch
Copy link
Contributor

dvc94ch commented Apr 30, 2020

yes, this repo is deprecated. the difference is that one is maintained while the other is not. @Osspial can we archive this repo?

@Jasper-Bekkers
Copy link

Does android-ndk-rs work with winit 0.19?

@dvc94ch
Copy link
Contributor

dvc94ch commented Apr 30, 2020

No, winit needs to integrate with the native activity. Here the native-app-glue is used to interact with the native activity. But there are multiple issues with that, for example native-app-glue doesn't handle orientation changes or viewport changes when the keyboard pops up. android-ndk-rs uses the native activity directly.

@dvc94ch
Copy link
Contributor

dvc94ch commented May 6, 2020

Thanks to @JasperDeSutter there's android support in winit master now rust-windowing/winit#1556

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

No branches or pull requests

3 participants