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

Why did the Android app stop running? #855

Open
historydev opened this issue Nov 1, 2024 · 1 comment
Open

Why did the Android app stop running? #855

historydev opened this issue Nov 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@historydev
Copy link

historydev commented Nov 1, 2024

I'm almost sure that it's my environment and I don't know what to try.

I rolled back the rust compiler to 1.80
Rolled back the macroquad library to 0.4.6
Took the minimal code and Cargo.toml and it still doesn't work!

When I open the app on the phone, it crashes immediately, but there are no errors in:

adb logcat -v brief SAPP:V "*:S"
--------- beginning of crash
--------- beginning of system
---------- beginning of main

main.rs:

use macroquad::prelude::*;

#[macroquad::main("MyGame")]
async fn main() {
loop {
clear_background(RED);

draw_line(40.0, 40.0, 100.0, 200.0, 15.0, BLUE);
 draw_rectangle(screen_width() / 2.0 - 60.0, 100.0, 120.0, 60.0, GREEN);

 draw_text("Hello, Macroquad!", 20.0, 20.0, 30.0, DARKGRAY);

 next_frame().await
}
}

Cargo.toml:

[package]
name = "mct2"
version = "0.1.0"
edition = "2021"

[dependencies]
macroquad = "=0.4.6"

[package.metadata.android]
package_name = "com.example"

[package.metadata.android.activity_attributes]
"android:exported" = "true"

I also checked that the docker container has not changed for 3 months, so it's my fault, but I have no idea where to look for the problem..

Everything works as it should on the computer.

Full list of actions and versions:
Compiler: 1.82 / 1.80.1
Macroquad: 0.4.13 / 0.4.6 / 0.4.0
Docker: Full clean and boot image
Project: Taken minimal example from the main page

Development system: win11
Launcher: android 11 phone / android 11 emulator

Save me! :O

@historydev
Copy link
Author

historydev commented Nov 1, 2024

I found a problem and I think it is necessary to change the logic that is its root.

For some reason the name lib*.so is built from the name of the crate rust: crate: SOME = libSOME so.
If the crate is named SOME, and the package name does not end with SOME - my situation occurs.

Crate name: SOME
Package name: com.not-some
libSOME.so = dlopen failed: library "libnot-some.so" not found

FATAL EXCEPTION: main
Process: com.not-some, PID: 18133
java.lang.UnsatisfiedLinkError: dlopen failed: library "libnot-some.so" not found

@not-fl3 not-fl3 added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants