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

import of dart:mirrors is not supported in the current Dart runtime #28

Open
ashwini1028 opened this issue Aug 25, 2019 · 5 comments
Open

Comments

@ashwini1028
Copy link

ashwini1028 commented Aug 25, 2019

I am trying to execute below code:

import 'dart:io';
import 'package:safe_config/safe_config.dart';

class ApplicationConfiguration extends Configuration {
ApplicationConfiguration(String fileName) : super.fromFile(File(fileName));

String password;
}

void main() {
var config = new ApplicationConfiguration("config.yaml");
print("${config.password}");
}

config.yaml is having:

password: pwd123

I am not sure why i am getting import error

import of dart:mirrors is not supported in the current Dart runtime

@itsjoeconway
Copy link
Contributor

dart:mirrors is the reflection library in Dart. Not sure what environment you are running on, but it is available on the Dart JIT VM. Work is currently in progress to provide a source-generated solution that does not depend on mirrors.

@aakashshah94
Copy link

I am having the same issue. I am trying to use the config file to build an application in android studio using flutter.

@AlbertoSaezVela
Copy link

Me too, my IDE is Intellij and I have the same issue.

@pycebs
Copy link

pycebs commented Nov 7, 2019

I have the same problem. I want to use the new dart2native to compile my CLI tool to a single binary, but dart2native does not support dart:mirrors.
(source: https://medium.com/dartlang/dart2native-a76c815e6baf)

Is there an ETA when the transition to the source-generated solution will be available?

safe_config is really useful. Especially with something like dart2native.

@itsjoeconway
Copy link
Contributor

In progress with: stablekernel/aqueduct#669

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

5 participants