cunarist / rinf

Rust for native business logic, Flutter for flexible and beautiful GUI
MIT License
2k stars 71 forks source link

rinf targetting i686-linux-android with emulator being x86_64 #437

Open polvallverdu opened 1 month ago

polvallverdu commented 1 month ago

Report

Rinf is building for i686-linux-android when running flutter run when ignoring in on gradle, and emulator being x86_64.

> flutter run --debug
Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Resolving dependencies...
Downloading packages...
  args 2.4.2 (2.5.0 available)
  collection 1.18.0 (1.19.0 available)
  crypto 3.0.3 (3.0.5 available)
  github 9.17.0 (9.24.0 available)
  http 1.1.0 (1.2.2 available)
  http_parser 4.0.2 (4.1.0 available)
  path 1.8.0 (1.9.0 available)
  petitparser 5.4.0 (6.0.2 available)
  toml 0.14.0 (0.16.0 available)
  version 3.0.0 (3.0.2 available)
Got dependencies!
10 packages have newer versions incompatible with dependency constraints.
Try `dart pub outdated` for more information.
Compiling bin/build_tool_runner.dart to kernel file bin/build_tool_runner.dill.
INFO: Precompiled binaries are disabled
INFO: Building hub for x86_64-linux-android
INFO: Building hub for i686-linux-android

Steps to Reproduce

Create a new project, use a crate that targets x86_64 (like lancedb), and let the build fail. Running it with flutter build --platform-target android-x64 doesn't building for i686-linux-android

System Information

rustc 1.81.0 (eeb90cda1 2024-09-04)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on Linux Mint 22 6.8.0-41-generic, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Linux toolchain - develop for Linux desktop
    ✗ GTK 3.0 development libraries are required for Linux development.
      They are likely available from your distribution (e.g.: apt install libgtk-3-dev)
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.2)
[✓] VS Code (version 1.92.2)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 3 categories.
temeddix commented 1 month ago

Hi @polvallverdu , thanks for the report :) Looks like this issue is somewhat similar to #413

Can you share if flutter run, not flutter run --debug, has the same behavior?

polvallverdu commented 1 month ago

Hi @polvallverdu , thanks for the report :) Looks like this issue is somewhat similar to #413

Can you share if flutter run, not flutter run --debug, has the same behavior?

I've seen that issue, and running build with the platform argument just works, it won't try to build for x86. Running with --debug does the same.

polvallverdu commented 1 month ago

Hey @temeddix , I found out that it's hardcoded functionality when debugging

https://github.com/cunarist/rinf/blob/main/flutter_package/cargokit/gradle/plugin.gradle#L136

I've forked the project, went to 6.15.0 tag, and commented that line, and it's working fine for me. That disables x86 building tho (atleast for debugging), but it's fine for me. I don't know what would be a good solution for everyone. Iirc x86 android devices are less than 1%

temeddix commented 1 month ago

I will try to make a PR at Cargokit repo when I have time, but I cannot guarantee when it will be. Any help reaching out to Cargokit would be greatly appreciated in the meantime.

As soon as Cargokit receives the fixed code, I will apply that to the main branch and publish a new Rinf version :)

FYI, Rinf is using Cargokit under the hood. /flutter_package/cargokit is a Git subtree directory pulled from Cargokit.

polvallverdu commented 1 month ago

Ahh, didn't notice. I'll be opening an issue on cargokit then. Thanks