You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resulting app-debug.apk only contains code for android-arm64.
Actual results
The resulting app-debug.apk contains code for android-arm, android-arm64, android-x86, android-x64.
When running without --debug, i.e. flutter build apk --target-platform=android-arm64 then the resulting app-release.apk correctly contains only code for android-arm64.
Why this is relevant
(Re)compiling Rust code for 4 target archs takes a loooong time (e.g. after a flutter clean). But I only need and only want to compile for one arch, because I am working on a physical test device. I expect --target-platform to work with --debug.
I see that by default one may want to include x86_64 and x86_32 for debug builds. But if I explicitly set --target-platform, I want this choice to be respected, and not have flutter and/or rinf trying to be clever and build for two additional platforms.
// Same thing addFlutterDependencies does in flutter.gradle
. So both Flutter and rinf would need to implement logic to respect --target-platform.
System Information
$ rustc --version
rustc 1.82.0-nightly (91376f416 2024-08-12)
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-CH)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.92.0)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 1 category
The text was updated successfully, but these errors were encountered:
I think we need to communicate with cargokit, because Rinf is basically using Cargokit under the hood. /flutter_package/cargokit is a Git subtree directory pulled from Cargokit.
Report
rinf always compiles for x86_64 and x86_32 when
--debug
is passed. Flutter's--target-platform
flag is ignoed.Steps to Reproduce
Expected results
The resulting
app-debug.apk
only contains code for android-arm64.Actual results
The resulting
app-debug.apk
contains code for android-arm, android-arm64, android-x86, android-x64.When running without
--debug
, i.e.flutter build apk --target-platform=android-arm64
then the resultingapp-release.apk
correctly contains only code for android-arm64.Why this is relevant
(Re)compiling Rust code for 4 target archs takes a loooong time (e.g. after a
flutter clean
). But I only need and only want to compile for one arch, because I am working on a physical test device. I expect--target-platform
to work with--debug
.I see that by default one may want to include x86_64 and x86_32 for debug builds. But if I explicitly set
--target-platform
, I want this choice to be respected, and not have flutter and/or rinf trying to be clever and build for two additional platforms.Context
I also filed a bug against this with Flutter: flutter/flutter#153359
Flutter implements this "default x86 behaviour" here: https://github.com/flutter/flutter/blob/6608936e6d430926eddc5759e2c4ca07dc873b03/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy#L642
Nevertheless, this still needs to be tracked for rinf separately. Because rinf does the same thing as Flutter:
rinf/flutter_ffi_plugin/cargokit/gradle/plugin.gradle
Line 130 in 5f9b00c
--target-platform
.System Information
The text was updated successfully, but these errors were encountered: