Skip to content
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

Can't generate files when using a local library or dependency_overrides #100

Closed
FDuhen opened this issue Apr 4, 2021 · 2 comments
Closed

Comments

@FDuhen
Copy link

FDuhen commented Apr 4, 2021

Hey,
I created a project to test the library and whenever I'm importing a local library in my test project (either by having a reference to it or using the dependency_overrides method), I do have the following error.

The pubspec.yaml file has changed since the pubspec.lock file was generated, please run "pub get" again.
pub finished with exit code 65

Here is the how to reproduce this issue.

  1. Clone any library, font_awesome_flutter for example
  2. Create a new project with a version of Flutter 2.0.3 or 2.0.4
  3. Implement the library font_awesome_flutter in the pubspec.yaml with the relative path to the previously cloned folder
  4. Import the build_runner and flutter_gen libs
  5. Run flutter pub get and flutter pub run build_runner build --delete-conflicting-outputs

pubspec.yaml

version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  font_awesome_flutter:
    path: ../font_awesome_flutter/

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
#  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner:
  flutter_gen:

And here is my flutter doctor -v

[✓] Flutter (Channel unknown, 2.0.3, on Mac OS X 10.15.6 19G2021 darwin-x64, locale en-FR)
    • Flutter version 2.0.3 at /Users/florian/fvm/versions/2.0.3
    • Framework revision 4d7946a68d (2 weeks ago), 2021-03-18 17:24:33 -0700
    • Engine revision 3459eb2436
    • Dart version 2.12.2

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/florian/Library/Android/sdk/
    • Platform android-30, build-tools 29.0.3
    • ANDROID_HOME = /Users/florian/Library/Android/sdk/
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.1, Build version 12A7403
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 191.6183.88

[✓] VS Code (version 1.43.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.6 19G2021 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.114

If I do the same thing but targeting the published package of font_awesome_flutter instead of the local one, no problem.
I may have missed a crucial information !
Thank you

@lcdsmao
Copy link
Member

lcdsmao commented Apr 4, 2021

Hi @FDuhen

Could you try again using flutter_gen_runner instead of flutter_gen?
In the recent release, we rename the package name for using with build_runner.

@FDuhen
Copy link
Author

FDuhen commented Apr 4, 2021

Thanks a bunch ! Looks like it's working as expected !

@FDuhen FDuhen closed this as completed Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants