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

Cannot run "flutter pub pub run build_runner watch" on Flutter dev channel #64

Closed
PavelPZ opened this issue Feb 25, 2020 · 7 comments · Fixed by #67
Closed

Cannot run "flutter pub pub run build_runner watch" on Flutter dev channel #64

PavelPZ opened this issue Feb 25, 2020 · 7 comments · Fixed by #67
Assignees

Comments

@PavelPZ
Copy link

PavelPZ commented Feb 25, 2020

I am using functional_widget for a long time (on both dev and master flutter dev channels).

After upgrading flutter dev channel last week, functional_widget-0.7.2 stops working (0.7.1 works well):

flutter pub pub run build_runner watch
[INFO] Generating build script...
[INFO] Generating build script completed, took 604ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 7.5s

[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
[SEVERE] /C:/Users/pzika/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/functional_widget-0.7.2/lib/function_to_widget_class.dart:216:43: Error: The getter 'isUndefined' isn't defined for the class 'DartType'. - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('/C:/Users/pzika/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.39.4/lib/dart/element/type.dart').Try correcting the name to the name of an existing getter, or defining a getter or field named 'isUndefined'.      'DiagnosticsProperty<${element.type.isUndefined ? findBeginToken(element) : element.type.displayName}>';                                          ^^^^^^^^^^^/C:/Users/pzika/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/functional_widget-0.7.2/lib/src/parameters.dart:57:20: Error: The gettePS 

C:\wikibulary\dart\know_how> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v1.15.3, on Microsoft Windows [Version 10.0.18362.657], locale cs-CZ)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    X No Java Development Kit (JDK) found; You must have the environment variable JAVA_HOME set and the java
      binary in your PATH. You can download the JDK from
      https://www.oracle.com/technetwork/java/javase/downloads/.
[√] Chrome - develop for the web
[!] Android Studio (version 3.5)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    X Unable to determine bundled Java version.
[√] VS Code (version 1.42.1)
[√] Connected device (2 available)

! Doctor found issues in 2 categories.
PS C:\wikibulary\dart\know_how>
@rrousselGit rrousselGit self-assigned this Feb 25, 2020
@karianpour
Copy link

It is caused by the following line:

'DiagnosticsProperty<${element.type.isUndefined ? findBeginToken(element) : element.type.displayName}>';

element.type.isUndefined is removed from analyzer 0.37.

I am looking for a workaround by overriding the dependencies.

@karianpour
Copy link

I used a workaround as follow and it worked for me:

dependencies:
  flutter_hooks: ^0.7.0
  functional_widget_annotation: ^0.5.1

dev_dependencies:
  functional_widget: ^0.7.1
  build_runner: ^1.7.3

dependency_overrides:
  analyzer: 0.36.4
  source_gen: 0.9.4+2

@danielmahon
Copy link

The workaround isn't working for me. Can't seem to find an acceptable combination to get functional_widget and flutter_hooks to work on the flutter beta channel

@truongsinh
Copy link
Contributor

FYI, this problem has escalated to stable channel of Flutter (1.17)

@rrousselGit
Copy link
Owner

I have another priority for the week

Then I'm full time on this + hooks issues

@truongsinh
Copy link
Contributor

I'm looking into this tos see whether I can make a PR

@truongsinh
Copy link
Contributor

ok, anyone want to try out my PR before @rrousselGit review my code, use this dependency declaration:

  functional_widget:
    git:
      url: git://github.com/truongsinh/functional_widget.git
      path: functional_widget
      ref: upgrade

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

Successfully merging a pull request may close this issue.

5 participants