-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
platform: macosIssues / PRs which are specifically for MacOS.Issues / PRs which are specifically for MacOS.plugin: cloud_firestoretype: documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Bug report
I'm try to use Firestore with Flutter Deskop (MacOS). But I'm getting always this error since my first try for a month.
[cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.
Steps to reproduce
- Created iosApp on Firebase and downloaded GoogleService-Info.plist file to macos project
- AppBundle (in Runner.xcworkspace) is edited like on Firebase
- Creted a collection and document on Firebase (myCollection/myDocument)
(All steps on https://firebase.flutter.dev/docs/installation/macos)
Expected behavior
I wish to get name value from myDocument on Firebase
Additional context
main.dart
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp()
.then((value) => print("connected " + value.options.asMap.toString()))
.catchError((e) => print(e.toString()));
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
FirebaseFirestore firestore = FirebaseFirestore.instance;
void _initializeApp() async {
await Firebase.initializeApp();
}
@override
void initState() {
_initializeApp();
super.initState();
}
@override
Widget build(BuildContext context) {
CollectionReference users =
FirebaseFirestore.instance.collection('myCollection');
return Scaffold(
appBar: AppBar(),
body: FutureBuilder<DocumentSnapshot>(
future: users.doc("myDocument").get(),
builder:
(BuildContext context, AsyncSnapshot<DocumentSnapshot> snapshot) {
if (snapshot.hasError) {
print(snapshot.error.toString());
return Text(snapshot.error.toString());
}
if (snapshot.connectionState == ConnectionState.done) {
Map<String, dynamic> data = snapshot.data.data();
return Text("Name: ${data['name']}");
}
return Text("loading");
},
),
);
}
}
Flutter doctor
Run flutter doctor and paste the output below:
Click To Expand
[✓] Flutter (Channel dev, 1.22.0-9.0.pre, on Mac OS X 10.15.5 19F101, locale en-TR)
• Flutter version 1.22.0-9.0.pre at /Users/leventkantaroglu/Development/flutter
• Framework revision 7a43175198 (13 days ago), 2020-08-28 23:18:04 -0400
• Engine revision 07e2520d5d
• Dart version 2.10.0 (build 2.10.0-73.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/leventkantaroglu/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 41.0.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.1
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.5 19F101
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 85.0.4183.102
• No issues found!
Flutter dependencies
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
Dart SDK 2.10.0-73.0.dev
Flutter SDK 1.22.0-9.0.pre
flutter_desktop_macos 1.0.0+1
dependencies:
- cloud_firestore 0.14.0+2 [flutter meta quiver firebase_core firebase_core_platform_interface cloud_firestore_platform_interface cloud_firestore_web]
- cupertino_icons 0.1.3
- firebase_core 0.5.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine]
dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data]
transitive dependencies:
- async 2.5.0-nullsafety [collection]
- boolean_selector 2.1.0-nullsafety [source_span string_scanner]
- characters 1.1.0-nullsafety.2
- charcode 1.2.0-nullsafety
- clock 1.1.0-nullsafety
- cloud_firestore_platform_interface 2.0.1 [flutter meta collection firebase_core plugin_platform_interface]
- cloud_firestore_web 0.2.0+1 [flutter flutter_web_plugins firebase http_parser meta firebase_core cloud_firestore_platform_interface js]
- collection 1.15.0-nullsafety.2
- fake_async 1.1.0-nullsafety [clock collection]
- firebase 7.3.0 [http http_parser js]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_web_plugins 0.0.0 [flutter characters collection meta typed_data vector_math]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- js 0.6.2
- matcher 0.12.10-nullsafety [stack_trace]
- meta 1.3.0-nullsafety.2
- path 1.8.0-nullsafety
- pedantic 1.9.0
- plugin_platform_interface 1.0.2 [meta]
- quiver 2.1.3 [matcher meta]
- sky_engine 0.0.99
- source_span 1.8.0-nullsafety [charcode collection path term_glyph]
- stack_trace 1.10.0-nullsafety [path]
- stream_channel 2.1.0-nullsafety [async]
- string_scanner 1.1.0-nullsafety [charcode source_span]
- term_glyph 1.2.0-nullsafety
- test_api 0.2.19-nullsafety [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.3.0-nullsafety.2 [collection]
- vector_math 2.1.0-nullsafety.2
HerrNiklasRaab, loic-hamdi, mtcliatt, tgpsantos, kakobayashi and 13 moremtcliatt, noinskit, mobiledev101 and Mayb3Nots
Metadata
Metadata
Assignees
Labels
platform: macosIssues / PRs which are specifically for MacOS.Issues / PRs which are specifically for MacOS.plugin: cloud_firestoretype: documentationImprovements or additions to documentationImprovements or additions to documentation