-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
flutter android cannot build #260278
Comments
Try with |
@RossComputerGuy |
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. I can help with testing & debugging. |
I can repro. I also believe the |
Hi 👋 I work on the Dart VS Code extension and think the reason for @darichey's issue could be that the file In the change linked above was this code: nixpkgs/pkgs/development/compilers/flutter/flutter.nix Lines 73 to 77 in 03e12d1
Deletion of |
@Fructokinase When do you think you can share your fix PR for review? |
Found a working solution for all of the issues above. @DanTup I'm not familiar with dart so hoping you can pitch in. |
I'm not sure I understand the difference - that last path is where I expected it to be (the Dart SDK is at |
I basically know nothing about flutter and android dev but I wanted to start a project. After investigating, I'm pretty sure the issue comes from this PR: flutter/flutter#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 03e12d1 the only solution yet? |
The solution in https://discourse.nixos.org/t/problem-building-flutter-app-for-android/35593/2 proposed by user |
Hi there! I created issue for documentation on this problem, and created a (mostly) working flake for building android projects. Issue: #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.The text was updated successfully, but these errors were encountered: