Skip to content

Error compiling to Android with cargo apk #1307

@naomijub

Description

@naomijub

Hi, I have tried to compile a project to android and I get this error.
Rust nightly:

error[E0599]: no method named `set_suspend_callback` found for reference `&winit::event_loop::EventLoopWindowTarget<T>` in the current scope
  --> /Users/julia.boeira/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.24.1/src/api/android/mod.rs:86:12
   |
86 |         el.set_suspend_callback(Some(Box::new(move |suspended| {
   |            ^^^^^^^^^^^^^^^^^^^^ method not found in `&winit::event_loop::EventLoopWindowTarget<T>`

error[E0615]: attempted to take value of method `SwapBuffersWithDamageKHR` on type `&api::egl::egl::Egl`
   --> /Users/julia.boeira/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.24.1/src/api/egl/mod.rs:694:17
    |
694 |         if !egl.SwapBuffersWithDamageKHR.is_loaded() {
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ method, not a field
    |
help: use parentheses to call the method
    |
694 |         if !egl.SwapBuffersWithDamageKHR(_, _, _, _).is_loaded() {
    |                                         ^^^^^^^^^^^^

error[E0615]: attempted to take value of method `SwapBuffersWithDamageKHR` on type `&api::egl::egl::Egl`
   --> /Users/julia.boeira/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.24.1/src/api/egl/mod.rs:740:13
    |
740 |         egl.SwapBuffersWithDamageKHR.is_loaded()
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ method, not a field
    |
help: use parentheses to call the method
    |
740 |         egl.SwapBuffersWithDamageKHR(_, _, _, _).is_loaded()
    |                                     ^^^^^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0599, E0615.
For more information about an error, try `rustc --explain E0599`.
error: could not compile `glutin`.

rust stable:

error[E0599]: no associated item named `EPSILON` found for type `f64` in the current scope
   --> /Users/julia.boeira/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.22.2/src/platform_impl/android/mod.rs:101:75
    |
101 |                         if (scale_factor - old_scale_factor).abs() < f64::EPSILON {
    |                                                                           ^^^^^^^ associated item not found in `f64`
    |
help: you are looking for the module in `std`, not the primitive type
    |
101 |                         if (scale_factor - old_scale_factor).abs() < std::f64::EPSILON {
    |                                                                      ^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: could not compile `winit`.

To learn more, run the command again with --verbose.
Error: Command 'cargo build --target aarch64-linux-android' had a non-zero exit code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions