Skip to content

"packages pub" doesn't release flutter lock #14703

Closed

Description

@aegis123

When running flutter packages pub run build_runner watch to generate model classes and keep the generated code up to date with the change I make. I can't build or install or hot reload the project I'm working on.
When I pressed the run button in intellij to compile and install the app I get the following error:

Waiting for another flutter command to release the startup lock...

When I kill the build_runner process it starts compiling and installing the project.

If I start the build_runner watch when the project is already running on a device or simulator/emulator
I get the follow error when I make a change to the code:

Initializing hot reload...
Your application could not be compiled, because its dependencies could not be established.
The following Dart file:
  /Users/user/projects/project/lib/value_models/models.dart
...refers, in an import, to the following library:
  /Users/user/projects/project/lib/value_models/models.g.dart
Unfortunately, that library does not appear to exist on your file system.

Is there a way to start a separate process for the code generation so we can keep compiling and running our apps during development?

Activity

  1. maksimr commented on Feb 28, 2018

    @maksimr

    @aegis123 I have faced this problem too.

    As a workaround, you could set FLUTTER_ROOT and then you can use flutter run and pub run build_runner watch(without flutter prefix) simultaneously

  2. Hixie commented on May 30, 2018

    @Hixie
    Contributor

    We need to release the lock before running pub.

  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 30, 2018
  4. added this to the milestone on May 30, 2018
  5. changed the title [-]running build_runner watch locks execution of flutter builds and hot reload[/-] [+]"packages pub" doesn't release flutter lock[/+] on May 30, 2018
  6. Hixie commented on Aug 21, 2018

    @Hixie
    Contributor

    @lfkdsk fixed this! Thanks!

  7. github-actions commented on Aug 15, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions