Open Fructokinase opened 1 year ago
Try with flutter run
or flutter build
. I'm pretty sure running gradle directly isn't supported by Flutter.
@RossComputerGuy flutter run
for android apps also fail because it calls gradle build under the hood
cc @vkryachko
cc @hacker1024 @FlafyDev looks like a regression during the 3.10->3.13 upgrade, mind taking a look? thanks
Ran into this issue today, I tried following the steps to set the GRADLE_OPTS parameter but that didn't work. Rolling back to Flutter 3.10.5 via this commit 03e12d1c86caab8d415f37308dd42d90dc208785 works for me.
I can help with testing & debugging.
I can repro. I also believe the FLUTTER_ROOT
issue may be related to https://github.com/Dart-Code/Dart-Code/issues/4800. Downgrading fixed that as well.
Hi 👋
I work on the Dart VS Code extension and think the reason for @darichey's issue could be that the file bin/snapshots/analysis_server.dart.snapshot
is missing from the Dart SDK.
In the change linked above was this code:
Deletion of dart-sdk
would certainly cause issues, but it's not clear to me if something is being put back in its place - and if so, whether it includes the snapshots/analysis_server.dart.snapshot
file?
@Fructokinase When do you think you can share your fix PR for review?
Found a working solution for all of the issues above. @DanTup snapshots/analysis_server.dart.snapshot
is there but is now under <FLUTTER_ROOT>/bin/cache/dart-sdk/bin/snapshots
so ln -sf $out/bin/cache/dart-sdk/bin/snapshots $out/bin/snapshots
this should fix it. But perhaps there are other things dart-sdk/bin that I am missing.
I'm not familiar with dart so hoping you can pitch in.
snapshots/analysis_server.dart.snapshot
is there but is now under<FLUTTER_ROOT>/bin/cache/dart-sdk/bin/snapshots
I'm not sure I understand the difference - that last path is where I expected it to be (the Dart SDK is at bin/cache/dart-sdk
and the snapshot is at bin/snapshots/...
in the Dart SDK). It does not need to be in the bin
folder of the Flutter SDK.
I basically know nothing about flutter and android dev but I wanted to start a project.
I have the same error doing flutter create..
flutter build apk
.
After investigating, I'm pretty sure the issue comes from this PR: https://github.com/flutter/flutter/pull/123511
I don't really know how to move forward with that, but I'm hoping that might save some investigation time.
I'm still unable to find any workaround to use flutter on either 23.05 or unstable. Is there any?
Is going back to https://github.com/NixOS/nixpkgs/commit/03e12d1c86caab8d415f37308dd42d90dc208785 the only solution yet?
The solution in https://discourse.nixos.org/t/problem-building-flutter-app-for-android/35593/2 proposed by user chito
worked for me.
Hi there! I created issue for documentation on this problem, and created a (mostly) working flake for building android projects. Issue: https://github.com/NixOS/nixpkgs/issues/267263
Describe the bug
Android apps create from flutter cannot be built. This issue popped up after the recent update. I think it was working for when flutter was still 3.10.0 on nixpkgs.
Steps To Reproduce
Steps to reproduce the behavior:
flutter create myapp
cd myapp/android && ./gradlew assembleDebug
This issue has also been reported on stackoverflow
Expected behavior
gradlew assembleDebug
should workScreenshots
Please see the stackoverflow link
Additional context
Specific issues.
Flutter gradle plugin attempts to be built under $FLUTTER_SDK/flutter_tools/gradle. Since $FLUTTER_SDK is read only in nix, this causes the issue mentioned. As far as I know, Gradle includeBuild for plugins have no other way of specifying the buildDir other than directly in the plugin build.gradle file itself. A workaround I found was by patching build.gradle.kts with a line like buildDir = File(System.getenv("FLUTTER_GRADLE_PLUGIN_BUILDDIR"))
FLUTTER_ROOT points to the wrong root?
flutter doctor -v
points to the unwrapped root. In the android folder for example, local.properties ends up pointing to the unwrapped flutter (I'm assuming unwrapped flutter is not intended to be used directly). I workaround I found was by patching FLUTTER_ROOT in shared.sh to point to the wrapped-linked sdk. Related, I also needed to symlink .git dir from wrapped-link to unwrapped.Notify maintainers
@babariviere @ericdallo @FlafyDev @hacker102
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.