-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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: init 1.12.13+hotfix.8 #76420
Conversation
fd6a76c
to
9f78c51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it works after the Maybe a patch somewhere to change this cache dir? |
I have fixed it with this new patch 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works very well, congratulations for the work @babariviere
Running
Is this an issue with my setup or an issue with the packaged version? I've put flutter in my |
I've checked the project clean out from git and it worked, so this seems to be an issue with my old project files. Thanks for packaging this! |
Hi, I am happy that you have a solution ! I will still look if there is an issue that I might have to patch ! |
@babariviere Sure, this is my old
Some more info: I had flutter manually installed in |
Thank you ! I will look into it |
I tried building my app, after fixing some issues related to changed library versions, the build now fails with this:
And when checking the
We can see it looks like it is missing I guess this midght be fixed by patching At this point, I'm not sure if this is an issue with my setup or the flutter package. I installed the android sdk through android studio's package manager. I'm using Android Studio v3.5.3. For the curious, the flutter project I'm trying to compile can be found here: https://kolaente.dev/vikunja/app/src/branch/fix/updated-fixes Edit: The app is building in my CI, which is running in a docker container based on ubuntu, so the app itself is definitly working. |
I will try to patch your issue, thanks for your report |
I have a pushed a potential fix, can you try it ? |
It seems to work with the command line now, thanks! On an interesting side note, the Now I just need to figure out a way to get this working within android studio... |
What's your issue with Android Studio ? To make it work, I go to Settings > Flutter Example: $ which flutter-beta
/run/current-system/sw/bin/flutter-beta
$ cat /run/current-system/sw/bin/flutter-beta
#!/nix/store/xb062l4b76zyhq6grqf4iyfdikkpg8fl-bash-4.4-p23/bin/bash
export PUB_CACHE=${PUB_CACHE:-"$HOME/.pub-cache"}
/nix/store/9xyasfp1841bzkkaasp4vndjigijm13r-flutter-beta-1.12.13+hotfix.6-fhs-env/bin/flutter-beta-1.12.13+hotfix.6-fhs-env /nix/store/7vnqzs94ghismhfd19vv9gg3kgwx58fp-flutter-beta-1.12.13+hotfix.6-unwrapped/bin/flutter --no-version-check "$@"
# You need to copy path /nix/store/7vnqzs94ghismhfd19vv9gg3kgwx58fp-flutter-beta-1.12.13+hotfix.6-unwrapped in this case. I don't know if I can fix it with this package but if I find a simpler way to do it, I will share it here. |
Yeah, I've set that path which lets me build the project, but the build finishes with
I get an apk which I could run, but it is not installed and started on my emulator. There is an issue at flutter about this, it seems this is not related to the nixos build of flutter: flutter/flutter#44796 |
|
Thanks for your help and patience! |
No problem ! It's a pleasure to help you |
@babariviere using this package means I have to build my flutter project using android studio? Is it possible to use other IDE like emacs (with https://github.com/amake/flutter.el for example) |
@Rizary You can use it to build outside of Android Studio. |
Nice work @babariviere - so glad to see this finally coming to Nix! I'm going to have a play around with it over the next few days, but one thing I've picked up already: In fact, it might be a good idea to make sure all the required tools (listed at the top of the install docs https://flutter.dev/docs/get-started/install/linux) are available 👍 |
Thank you ! |
Amazing! Thank you very much @babariviere |
@babariviere Thank you very much for this PR! I created a nix-shell based on the merge commit and flutter itself works great, but I have a problem with Android Studio: the built-in Terminal always closes immediately after opening it, so it is unusable (which also prevents me from using adb since the cmdline adb version seems to be incompatible with the studio one and they kill each other all the time, losing the adb wifi connection to the device). Do you have a working Android Studio terminal that works with your flutter packages (flutter stable channel)? If so, please let me know the version of Android Studio (or even better the nixpkgs commit ref) you are using, since I have been fighting with this without success. My nix-shell:
|
Hey @nioncode, I have tested with my Android Studio. I don't have this issue.
Can you test if you have the same issue with this repository ? https://github.com/babariviere/flutter-nix-hello-world |
@babariviere thanks for the fast response. I can reproduce the problem with your repository. With Android Studio 3.5.3:
With Android Studio 3.6.2:
I thought you might be using an Android Studio version > 3.5.3, since for me the dart analyzer always crashed on the older versions and I hoped this is a known issue, but apparently this only happens on my system. Do you have any idea how I could debug this? |
@nioncode have you seen this comment #76420 (comment) ? It might solve your issue |
@babariviere I don't think this applies to my issue. Android Studio v3.5.3 should work without problems with flutter stable v1.12.13+hotfix.8 (which is proven since you run exactly this version), but in my case the dart analyzer just crashes all the time. And Android Studio v3.6.2 at least works correctly for regular usage with flutter for me (I'm using |
@babariviere ok, I think I found a few interesting things. First: on Android Studio v3.5.3, if I go into the Terminal and run flutter doctor, I immediately get a segfault. strace shows that this happens after opening However, I could make Android Studio v3.6.2 successfully open the terminal by changing the Terminal settings in Would you mind having a look what your To me this looks to be some kind of incompatibilities between the binaries I have in the FHS env and the binaries I have on my system. Is this the expected behavior, because of the FHS env? I never experienced something like this before honestly. |
You shouldn't change the bash path in Android Studio as it is set to the path of the bash inside the FHS env. Can you try to install flutter globally ? |
Hmm apparently it is not set to the path of bash of the FHS env for me, but to the global bash. That's why when i change the path to be the path in FHS env. When I follow the path for
So in the end it points to |
It's weird, I can't reproduce your issue 😅 |
At least I got a working terminal again by using |
no problem 👍 |
Hey @babariviere, Im using this and it's working great.
But the flutter executable is in other folder than that:
Do you know how can I access this If some way I could access via a symlink from the flutter bin dir, it will solve this |
Hey @ericdallo, you can find the "unwrapped" path just by opening the file |
I'm still having issues with the
but Error below:
|
this is usually solved by running |
@tgunnoe By removing the |
ah yes, but how then do you use androidsdk the nix way? without |
error: Package ‘flutter-beta-1.15.17’ in /nix/store/wjgdngf3sykb16kgj57iggrinlfcghgz-nixpkgs-20.09pre221549.7e07846d99b/nixpkgs/pkgs/development/compilers/flutter/flutter.nix:113 is not supported on ‘x86_64-darwin’, refusing to evaluate. Are there any plans to support macOS? |
@tgunnoe can you show me the content of ../nixpkgs directory ? It looks like it might be the issue. Otherwise, you can take a look at my example repo here: https://github.com/babariviere/flutter-nix-hello-world. It has a working default.nix/shell.nix file. @mpfaff I could do it, but I have no Mac to test it. If you can help me with testing, I will gladly do it. |
@babariviere It was just a cloned version of github.com/nixos/nixpkgs, but i changed it back to |
@babariviere I don't have much experience with Nix yet, but I'd be happy to help. |
@babariviere I tried the example repository as well with the same result (flutter doctor printing
produces:
which, when ran, shows the license accepting document properly, but yields:
Because of course, its not writable here. I'm trying not to abandon the nix way and using android-studio to download/accept licenses. |
I think i need to provide an override for the derivation If I don't use set I believe there is a version mismatch with license accepting? |
Ok I've reached the end of my investigation. You can't accept the license through nix configuration, so flutter doctor will always report the license status as unknown. the Here's the relevant check, but this does not write the license as accepted in the SDK nixpkgs/pkgs/development/mobile/androidenv/compose-android-packages.nix Lines 192 to 195 in 5be571e
Here are the relevant issues I found: For now, I will use my home path to store the SDK and accept the license there, or see if i can work around flutter with license status unknown. |
This probably happens because the SDK in the store is read only and the dialog wants to write to it. Do you know what format this "accepted license" thing is (output of |
@matthewbauer sorry for the late reply. As I mentioned yes it's read-only and flutter does want to write to that directory. the end result of This comment #23910 (comment) has solved the mystery for me. |
Motivation for this change
Fix issue #36759.
There is still some changes to do. I will note them as comments.
For now, it's using dart from the source, maybe I need to use dart from nixpkgs ?
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)