cargo-mobile icon indicating copy to clipboard operation
cargo-mobile copied to clipboard

error: attribute must be applied to a `static` variableLE

Open elkhoudiry opened this issue 4 years ago • 2 comments

I'm getting this error when trying to cargo android run

I'm using arch linux for now and ndk version 22, is there anything i'm missing ?

error: attribute must be applied to a `static` variableLE
   --> /home/ahmed/.cargo/registry/src/github.com-1ecc6299db9ec823/oboe-0.3.1/src/audio_stream.rs:625:5 IDLE
    |
625 |     #[used]
    |     ^^^^^^^

error: could not compile `oboe` due to previous errorIDLE
warning: build failed, waiting for other jobs to finish...rustBuildArm64Debug
error: build failed EXECUTING [2m 28s]
error: `Failed to run `cargo build`
    Command "cargo build --package cute-name --manifest-path
    /home/ahmed/gits/cargo-mobile/cute-name/Cargo.toml --target
    aarch64-linux-android --color always" didn't complete successfully, exiting
    with code 101.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:rustBuildArm64Debug'.
> Process 'command 'cargo'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

BUILD FAILED in 5m 38s
error: Failed to assemble APK
    Command "/home/ahmed/gits/cargo-mobile/cute-name/gen/android/cute-name/gradlew --project-dir
    /home/ahmed/gits/cargo-mobile/cute-name/gen/android/cute-name assembleArm64Debug --warn" didn't complete
    successfully, exiting with code 1.

elkhoudiry avatar Oct 08 '21 09:10 elkhoudiry

Hello, I think it's an issue with the version of oboe package that you're using, similar to this issue.

Try bumping oboe version to 0.4.1 and see if it helps.

zeerooth avatar Oct 16 '21 11:10 zeerooth

will try that and investigate further this weekend

elkhoudiry avatar Oct 19 '21 08:10 elkhoudiry