Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Getting Error when running the firestore example #10

Closed
arrrrny opened this issue Dec 2, 2019 · 1 comment
Closed

Getting Error when running the firestore example #10

arrrrny opened this issue Dec 2, 2019 · 1 comment

Comments

@arrrrny
Copy link

arrrrny commented Dec 2, 2019

Future<void> main(List<String> args) async {
  Log.level = LogLevel.w;
  final FirebaseOptions options = FirebaseOptions(
    apiKey: "AIzaSyB*******",
    projectId: "********",
    storageBucket: "*****810.appspot.com",
    applicationId: '1:****:web:31666888a0e4****264f1',
    databaseUrl: 'https://******0.firebaseio.com',
    gcmSenderId: '********',
  );
  final FirebaseApp app =
      FirebaseApp.withOptions(options, ServiceCredential('token.dat'), checkConnection, "Angel");
  final FirebaseFirestore firestore =
      await FirebaseFirestore.getInstance(app, openDatabase: DatabaseMock.create);
  firestore.collection('price').document('1000').get().then((DocumentSnapshot ds) {
    print(ds.data);
  });
  // print(firestore.document('/price/1000').snapshots.first.toString());
}

Future<bool> checkConnection() async => true;
main.dart: Warning: Interpreting this as package URI, 'package:vm_example/main.dart'.
null
Unhandled exception:
FirebaseFirestoreError:unavailable Failed to get document because the client is offline. null null
#0      DocumentReference._getViaSnapshotListener.<anonymous closure> (package:firebase_firestore/src/firebase/firestore/document_reference.dart:191:9)
#1      _MapStream._handleData (dart:async/stream_pipe.dart:227:21)
#2      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164:13)
#3      _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#6      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:132:11)
#7      _MapStream._handleData (dart:async/stream_pipe.dart:232:10)
#8      _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:164:13)
#9      _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#10     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#11     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#12     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:764:19)
#13     _StreamController._add (dart:async/stream_controller.dart:640:7)
#14     _StreamController.add (dart:async/stream_controller.dart:586:5)
#15     _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#16     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#17     _DelayedData.perform (dart:async/stream_impl.dart:591:14)
#18     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
#19     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:667:7)
#20     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#21     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#22     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:391:30)
#23     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:416:5)
#24     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)

@long1eu
Copy link
Owner

long1eu commented Aug 29, 2020

This should be fixed now

@long1eu long1eu closed this as completed Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants