Skip to content

Is this library compatible with flutter? #67

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

Closed
DhavalRKansara opened this issue Dec 6, 2019 · 5 comments · Fixed by dart-archive/gcloud#85
Closed

Is this library compatible with flutter? #67

DhavalRKansara opened this issue Dec 6, 2019 · 5 comments · Fixed by dart-archive/gcloud#85

Comments

@DhavalRKansara
Copy link

I have tried to implement this library with a flutter project and got the below errors:

E/flutter ( 1549): [ERROR:flutter/shell/common/shell.cc(178)] Dart Error: error: import of dart:mirrors is not supported in the current Dart runtime
E/flutter ( 1549): [ERROR:flutter/shell/common/engine.cc(188)] Could not prepare to run the isolate.
E/flutter ( 1549): [ERROR:flutter/shell/common/engine.cc(127)] Engine not prepare and launch isolate.
E/flutter ( 1549): [ERROR:flutter/shell/common/shell.cc(407)] Could not launch engine with configuration.

My pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  gcloud: ^0.6.3

Even though googleapis_auth is already present in dev_dependencies of gcloud package still when I tried to import 'package:googleapis_auth/auth_io.dart' as auth; it gives me the following error: Target of URI doesn't exist: 'package:googleapis_auth/auth_io.dart'.

@sigurdm
Copy link
Contributor

sigurdm commented Dec 6, 2019

I have tried to implement this library with a flutter project and got the below errors:

The gcloud package uses dart:mirrors that is not supported in the Flutter runtime. That should be explained in the readme. I'll keep this issue open for that.

Even though googleapis_auth is already present in dev_dependencies of gcloud package still when I tried to import 'package:googleapis_auth/auth_io.dart' as auth; it gives me the following error: Target of URI doesn't exist: 'package:googleapis_auth/auth_io.dart'.

You do not get the dev_dependencies of your dependencies with pub get.
The dev_dependencies of package:foo are packages you need for developing package:foo (usually for testing or generating code), not for using it.

Furthermore it is in general not the best practice to depend on your dependencies' dependencies. If you want to refer to something from package:foo in your own package, add it as an explicit dependency.

If your want to use package:googleapis_auth from your package, add it to the dependencies of your own package.

@DhavalRKansara
Copy link
Author

@sigurdm Thanks for your reply.

@DhavalRKansara
Copy link
Author

So, Is there any other way by which I can establish a connection with Google Cloud pub-sub?

@sigurdm
Copy link
Contributor

sigurdm commented Dec 9, 2019

I think https://pub.dev/packages/googleapis is currently your best bet...

@mockturtl
Copy link

mockturtl commented Dec 22, 2019

@sigurdm You should mention explicitly that dart:mirrors also breaks dart2native -- that isn't addressed by dart-archive/gcloud#85.

Use case: I want to deploy a minimal container using package:appengine. (rationale here)

related: #38

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

Successfully merging a pull request may close this issue.

4 participants