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

NoSuchMethodError: No static getter 'terminal' declared in class 'StdioType' #1448

Closed
kbrz opened this Issue May 15, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@kbrz

kbrz commented May 15, 2018

Hello!

I am trying to use built_value in my flutter project. I get an error while running flutter packages pub run build_runner build.

• Flutter version 0.3.2 at <removed>
• Framework revision 44b7e7d3f4 (4 weeks ago), 2018-04-20 01:02:44 -0700
• Engine revision 09d05a3891
• Dart version 2.0.0-dev.48.0.flutter-fe606f890b
• build_runner version 0.8.9
• System MacOSX

And this is terminal output of the command I run:

[INFO] Generating build script...
[INFO] Generating build script completed, took 331ms



You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues


NoSuchMethodError: No static getter 'terminal' declared in class 'StdioType'.
Receiver: StdioType
Tried calling: terminal
dart:core                                                       NoSuchMethodError._throwNew
package:build_runner/src/environment/io_environment.dart 67:35  _canPrompt
package:build_runner/src/environment/io_environment.dart 35:47  new IOEnvironment
package:build_runner/src/generate/build_impl.dart 77:11         build
package:build_runner/src/generate/build.dart 71:5               build
package:build_runner/src/entrypoint/build.dart 28:24            BuildCommand.run
package:args/command_runner.dart 194:27                         CommandRunner.runCommand
package:args/command_runner.dart 109:29                         CommandRunner.run.<fn>
dart:async                                                      new Future.sync
package:args/command_runner.dart 109:11                         CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31              run
.dart_tool/build/entrypoint/build.dart 11:22                    main

pub finished with exit code 1
@kmorkos

This comment has been minimized.

kmorkos commented May 16, 2018

Downgrading to 0.8.8 fixed this for me. Seems like something in the latest update broke this.

@natebosch

This comment has been minimized.

Member

natebosch commented May 16, 2018

We may be relying on details from a later SDK without correctly setting the constraint in our pubspec

@natebosch

This comment has been minimized.

Member

natebosch commented May 16, 2018

@grouma can you check where we are using this symbol and see if we need to set a higher lower bound for the SDK?

@kbrz

This comment has been minimized.

kbrz commented May 16, 2018

I just updated flutter to the latest version available on dev channel (0.4.4) and this also fixed this for me.

@jaumard

This comment has been minimized.

jaumard commented May 16, 2018

Just add the same error with fresh install of Flutter on mac

NoSuchMethodError: No static getter 'terminal' declared in class 'StdioType'.
Receiver: StdioType
Tried calling: terminal
dart:core                                                       NoSuchMethodError._throwNew
package:build_runner/src/environment/io_environment.dart 67:35  _canPrompt
package:build_runner/src/environment/io_environment.dart 35:47  new IOEnvironment
package:build_runner/src/generate/build_impl.dart 77:11         build
package:build_runner/src/generate/build.dart 71:5               build
package:build_runner/src/entrypoint/build.dart 28:24            BuildCommand.run
package:args/command_runner.dart 194:27                         CommandRunner.runCommand
package:args/command_runner.dart 109:29                         CommandRunner.run.<fn>
dart:async                                                      new Future.sync
package:args/command_runner.dart 109:11                         CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31              run
.dart_tool/build/entrypoint/build.dart 11:22                    main

pub finished with exit code 1

Flutter 0.3.2 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 44b7e7d3f4 (4 weeks ago) • 2018-04-20 01:02:44 -0700
Engine • revision 09d05a3891
Tools • Dart 2.0.0-dev.48.0.flutter-fe606f890b

I under a new project and just trying to use 'package:json_annotation/json_annotation.dart' user example from the doc :/

@jaumard

This comment has been minimized.

jaumard commented May 16, 2018

Downgrading to 0.8.8 fix the problem for me also :)

@jakemac53

This comment has been minimized.

Contributor

jakemac53 commented May 16, 2018

Are sdk constraints not being respected for flutter projects for some reason I wonder? The latest version has an skd constraint of sdk: '>=2.0.0-dev.54 <2.0.0' so you shouldn't have been able to get it.

Closing this issue as we have proper sdk constraints as far as I know, but you may want to open another issue elsewhere (on flutter or pub?).

@jakemac53 jakemac53 closed this May 16, 2018

@jakemac53

This comment has been minimized.

Contributor

jakemac53 commented May 16, 2018

Fwiw, this doesn't appear to be an issue with pub_semver, the following prints the expected output:

import 'package:pub_semver/pub_semver.dart';

main() {
  var flutterVersion = new Version.parse('2.0.0-dev.48.0.flutter-fe606f890b');
  var sdkMinVersion = new Version.parse('2.0.0-dev.54');
  var sdkMaxVersion = new Version.parse('2.0.0');
  var sdkRange = new VersionRange(
      min: sdkMinVersion, max: sdkMaxVersion, includeMin: true);
  print(sdkRange.allows(flutterVersion));  // prints false
  print(sdkMinVersion >= flutterVersion);  // prints true
}
@natebosch

This comment has been minimized.

Member

natebosch commented May 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment