Cannot enable firestore for this project an unknown error occurred

dhaval kaneriya

dhaval kaneriya

unread,

May 23, 2021, 4:32:28 PM5/23/21

to google-cloud-firestore-discuss

I’m trying to create firestore database and I’m getting below error.

Cannot enable Firestore for this project

An unknown error occurred

I’ve tried to create firestore with old google account and newly crated google account. AnNd in both case I’m getting same error.

firestore_error.png

Sam Stern

unread,

May 24, 2021, 2:34:11 PM5/24/21

to dhaval kaneriya, google-cloud-firestore-discuss

Hi Dhaval,

For this issue it may be best to contact Firebase support:

If possible you should include any errors you’re seeing in the browser developer tools panel.

— Sam

Mighty Indians

unread,

Jul 18, 2021, 7:33:10 AM7/18/21

to google-cloud-firestore-discuss

just try to disable any cors extention from the browser if you have installed one.

Debasmit Roy

unread,

Aug 15, 2021, 12:28:03 PM8/15/21

to google-cloud-firestore-discuss

Change your browser. I was previously trying on Safari. Then. I used Chrome. It got solved.

Samuel Hughes Mensah

unread,

Dec 22, 2021, 8:04:46 PM12/22/21

to google-cloud-firestore-discuss

two options

1. deactivate 

any cors extension from the browser if you have installed one

2. switch browsers if step one doesn’t work.

lucifer warlord

unread,

Mar 23, 2022, 8:55:40 PM3/23/22

to google-cloud-firestore-discuss

Jay P

unread,

Jul 17, 2022, 2:46:21 PM7/17/22

to google-cloud-firestore-discuss

Yep the cors thing did it for me!

brayden fulken

unread,

Sep 26, 2022, 2:12:32 PM9/26/22

to google-cloud-firestore-discuss

Disabling CORS worked for me too, Thank you.

Alex I

unread,

Dec 5, 2022, 9:50:22 PM12/5/22

to google-cloud-firestore-discuss

Can’t believe that deactivating adblocker fixed the issue…

003 ABHIRAJ CHATTERJEE

unread,

Dec 19, 2022, 12:04:18 PM12/19/22

to google-cloud-firestore-discuss

@Ilya-Lad

Windows 10, modern Chrome.
After selecting Start in test mode, a blue button Next is shown on the form (Instead of the button Enable shown in the tutorial). Clicking the Next button shows the form for selecting Cloud Firestore location, with num5(us-central) being selected by default. That location is appropriate in my case. The blue button Done is shown in the right bottom of the form. Clicking the button cause a spinning cursor for about a minute, and then causes an error:

«Cannot enable Firestore for this project
An unknown error occurred»

(Attempt to follow the tutorial farther shows that the mock data is not added to the DB).

@Ilya-Lad

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

@amreldsokey

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

how you solve it ?

@Ilya-Lad

On the day it was the problem, the Firebase status indicated issues. My problem gone on its own the next day, and the Firebase status did not show  issues on that day. So I interpreted it that my problem resulted from the Firebase  issues.
On Monday, June 8, 2020, 08:33:01 AM EDT, amreldsokey <notifications@github.com> wrote:

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

how you solve it ?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.

Ilya-Lad

Problem to follow Cloud Firestore Web Codelab Tutorial, page 2, step 3

Windows 10, modern Chrome.
After selecting Start in test mode, a blue button Next is shown on the form (Instead of the button Enable shown in the tutorial). Clicking the Next button shows the form for selecting Cloud Firestore location, with num5(us-central) being selected by default. That location is appropriate in my case. The blue button Done is shown in the right bottom of the form. Clicking the button cause a spinning cursor for about a minute, and then causes an error:

«Cannot enable Firestore for this project
An unknown error occurred»

(Attempt to follow the tutorial farther shows that the mock data is not added to the DB).

Ilya-Lad

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

amreldsokey

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

how you solve it ?

Ilya-Lad

On the day it was the problem, the Firebase status indicated issues. My problem gone on its own the next day, and the Firebase status did not show  issues on that day. So I interpreted it that my problem resulted from the Firebase  issues.
On Monday, June 8, 2020, 08:33:01 AM EDT, amreldsokey <notifications@github.com> wrote:

Today the problem has gone. I looked in the status info. Yesterday they had issues. Not sure what that all means. But I close the issue.

how you solve it ?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or unsubscribe.

@victorshn those warnings are safe to ignore

Performing full restart…
compiler message: lib/main.dart:43:38: Error: A value of type ‘#lib1::Auth’ can’t be assigned to a variable of type ‘#lib2::BaseAuth’.
compiler message: Try changing the type of the left hand side, or casting the right hand side to ‘#lib2::BaseAuth’.
compiler message: home: new RootPage(auth: new Auth())
compiler message:

I got those errors and I don’t know why?

@fmatosqg flutter shows only that build error, how to get more details?

I am trying to allow users to sign in from the app to the firsebase

@nassimbjf this looks like an issue I had before, it’s something to do with how your imports are set

I had this issue when one import was relative, and another was the full path

I changed them all to the full path, and the issue went away

import ‘package:flutter/material.dart’;
import ‘login_page.dart’;
import ‘auth.dart’;
import ‘root_page.dart’;

yeah, so make them all full paths, so in other words, have them all start with package: followed by the path to the dart file

not sure if that’ll fix it, but it did for me

Thank you so much @axmccx

I’m really so happy because I am in this group chat

i am getting input from a textfield with maxlines if the user press enter it moves to next line(this works when user is typing) buh it does not appear on diffirent lines when I convert it to the pdf. any help

maybe something to do with the line endings?

some incompatibility between how the textfield deals with them and how the pdf package does

I wonder if debugger can show you

@axmccx

W/IInputConnectionWrapper(29392): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(29392): getTextBeforeCursor on inactive InputConnection
I/flutter (29392): ══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
I/flutter (29392): The following assertion was thrown while handling a gesture:
I/flutter (29392): type 'Future<dynamic>' is not a subtype of type 'Future<Null>' where
I/flutter (29392):   Future is from dart:async
I/flutter (29392):   Future is from dart:async
I/flutter (29392):   Null is from dart:core
I/flutter (29392): 
I/flutter (29392): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter (29392): more information in this error message to help you determine and fix the underlying cause.
I/flutter (29392): In either case, please report this assertion by filing a bug on GitHub:
I/flutter (29392):   https://github.com/flutter/flutter/issues/new
I/flutter (29392): 
I/flutter (29392): When the exception was thrown, this was the stack:
I/flutter (29392): #0      pdfview (package:pdfview/pdfview.dart:12:21)

looks intense, what does the line at pdfview.dart:12:21 look like?

@axmccx

 home:  new MyApp(),

@axmccx I was also shocked

how to add wrap with StreamBuilder AS ?

@axmccx

   return _channel.invokeMethod('pdfview', text);

@norbertkross doea the method that line of code comes from

yeah I’m sorry, I can’t say much with these single lines, might be best to go through it, ensure you understand each line

how do I go about troubleshooting my app when it crashes immediately after start. I’ve been commenting out as much as I can to see what’s causing the issue

Restarting the Dart Analysis server seems to have fixed my issue, who knew

Hello, I want a step by step tutorial to integrate Firebase Auth in my Flutter app. Can anyone help me find out?

@saeedjassani I’m on the phone can’t search. There used to be a codelab for that. If you can’t find it to through github.com/flutter and check the chat sample app

@saeedjassani Here’s the codelabs for firebase, but I think it’s for firestore

Screen Shot 2018-05-12 at 9.48.12 AM.png

[dart] The redirecting constructor can’t have a field initializer.

you can’t partially redirect a constructor, you have to forward all of those args through

I wanna ask one simple question. I have three pages in APP (using bottom navigation switch them), BUT every time switch the page are newly created the data are loaded from scratch. How to let page new only once when open the app?

onTap: () => Navigator.of(context).push(new MaterialPageRoute(
                      builder: (BuildContext context) => new Detail(
                          id: id,
                          name: name,
                          image: image,

@jinfagang not the best practice but this would do what you’re looking for

@abidaparveen Thanks for reply. What u are showing seems just push to next detail. How ever I wanna ask something like this:

Dont know how to send picture here. I am simply using a bottom navigation navigate 3 pages

Every time switch them, the page will be new created and the data inside will be refresh

class _MyHomePageState extends State<MyHomePage> {
PageController pageController;
int page = 0;

// Widget indexPage = new IndexPage();
// Widget searchPage = new SearchPage();
// Widget morePage = new MorePage();
// List<Widget> pageViewChildren = [indexPage, searchPage, morePage];
List<Widget> pageViewChildren = [new IndexPage(), new SearchPage(), new MorePage()];

@override
Widget build(BuildContext context) {
return new Scaffold(
body: new PageView(
children: pageViewChildren,
controller: pageController,
onPageChanged: onPageChanged
),
bottomNavigationBar: new BottomNavigationBar(items: [
new BottomNavigationBarItem(
icon: new Icon(Icons.cloud),
title: new Text(«好券多»),
backgroundColor: Colors.grey),
new BottomNavigationBarItem(
icon: new Icon(Icons.search),
title: new Text(«搜券»),
backgroundColor: Colors.grey),
new BottomNavigationBarItem(
icon: new Icon(Icons.contacts),
title: new Text(«我的»),
backgroundColor: Colors.grey),
], onTap: onTap, currentIndex: page),
);
}

@override
void initState() {
super.initState();
pageController = new PageController(initialPage: this.page);
}

void onTap(int index) {
pageController.animateToPage(index,
duration: const Duration(milliseconds: 300), curve: Curves.ease);
}

void onPageChanged(int page) {
setState(() {
this.page = page;
});
}
}

class _MyHomePageState extends State<MyHomePage> {
  PageController pageController;
  int page = 0;

  // Widget indexPage = new IndexPage();
  // Widget searchPage = new SearchPage();
  // Widget morePage = new MorePage();
  // List<Widget> pageViewChildren = [indexPage, searchPage, morePage];
  List<Widget> pageViewChildren = [new IndexPage(), new SearchPage(), new MorePage()];


  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new PageView(
        children: pageViewChildren,
        controller: pageController, 
        onPageChanged: onPageChanged
      ),
      bottomNavigationBar: new BottomNavigationBar(items: [
        new BottomNavigationBarItem(
            icon: new Icon(Icons.cloud),
            title: new Text("好券多"),
            backgroundColor: Colors.grey),
        new BottomNavigationBarItem(
            icon: new Icon(Icons.search),
            title: new Text("搜券"),
            backgroundColor: Colors.grey),
        new BottomNavigationBarItem(
            icon: new Icon(Icons.contacts),
            title: new Text("我的"),
            backgroundColor: Colors.grey),
      ], onTap: onTap, currentIndex: page),
    );
  }

  @override
  void initState() {
    super.initState();
    pageController = new PageController(initialPage: this.page);
  }

  void onTap(int index) {
    pageController.animateToPage(index,
        duration: const Duration(milliseconds: 300), curve: Curves.ease);
  }

  void onPageChanged(int page) {
    setState(() {
      this.page = page;
    });
  }
}

Above is my codes. as u see, the pages which are children of PageView, they all newed very time switched

How to let it not to be newly create every time refresh it

yes this would refresh your page each time the user scroll through pages

How avoid that anyway? I dont want the data always refresh, that is too slow

@jinfagang try using different approach … you may end up spending too much time on it

Yeah, struggling on it. I will give it up if there not other solution

What people should do if we have such situation

there are more good people here .. someone will help

Guys, anyone … I’m new with IOS here ->
[!] No Xcode project found, please specify one

Jin can you show how is data refreshed

Well, I am previously an iOS developer

You should install XCode first

class _MySearchPageState extends State<MySearchPage> {
  @override
  Widget build(BuildContext context) {
    return new Container(
      padding: new EdgeInsets.only(top: 50.0),
      child: new Column(
        children: <Widget>[
          new Row(
            children: <Widget>[
              new TextField(
                decoration: new InputDecoration(hintText: "关键词/宝贝标题"),
              )
            ],
          )
        ],
      ),
    );
  }
}

This simply layout will crash, Why?

flutter: ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown during performLayout():
flutter: BoxConstraints forces an infinite width.
flutter: These invalid constraints were provided to RenderRepaintBoundary's layout() function by the
flutter: following function, which probably computed the invalid constraints in question:
flutter:   _RenderDecoration._layout.layoutLineBox (package:flutter/src/material/input_decorator.dart:747:11)
flutter: The offending constraints were:

class _MyBodyState extends State<MyBody> {
  List allGoods = [];
  int allGoodsPageNo = 1;

  RefreshMode loading = RefreshMode.idle, refreshing = RefreshMode.idle;

  Future<Null> getAllGoods() async {
    print('fuck');
    var _tbItemsUrl =
        "http://loliloli.pro/api/v3/taobao_items_hitui?page_no=$allGoodsPageNo&per_page=30";
    print(_tbItemsUrl);
    var response = await http.get(
      Uri.encodeFull(_tbItemsUrl),
    );
    var data = json.decode(response.body);
    print(data['data'][0]);
    print(data['status']);
    this.setState(() {
      allGoods.addAll(data['data']);
      this.allGoodsPageNo += 1;
      print("=> we got goods: ${allGoods.length}");
    });
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    // If it is singleton, then allGoods should not be none after first run
    if(this.allGoods.length != 0){
      print("不要加载了,已经加载过一次了。");
    }else{
      getAllGoods();
    }
  }

I getData every time page new created (if I don’t do this the data can not be get right?), But the question is also here, everytime switch it will update, I don’t want it

class _MyBodyState extends State<MyBody> {
  static List allGoods = [];
  int allGoodsPageNo = 1;

  RefreshMode loading = RefreshMode.idle, refreshing = RefreshMode.idle;

  Future<Null> getAllGoods() async {
    print('fuck');
    var _tbItemsUrl =
        "http://loliloli.pro/api/v3/taobao_items_hitui?page_no=$allGoodsPageNo&per_page=30";
    print(_tbItemsUrl);
    var response = await http.get(
      Uri.encodeFull(_tbItemsUrl),
    );
    var data = json.decode(response.body);
    print(data['data'][0]);
    print(data['status']);
    this.setState(() {
      allGoods.addAll(data['data']);
      this.allGoodsPageNo += 1;
      print("=> we got goods: ${allGoods.length}");
    });
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    // If it is singleton, then allGoods should not be none after first run
    if(allGoods != null || allGoods.length != 0){
      print("不要加载了,已经加载过一次了。");
    }else{
      getAllGoods();
    }
  }

Already tried that: if(allGoods != null || this.allGoods.length != 0){ it always return true

static List allGoods = [];

and never use this with static variables

BTW, I always got trouble in layout which is really annoying, but I really can not specific out where is going on wrong. Here is my simple layout:

Widget searchSection = new Container(
      child: new Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          new TextField(decoration: new InputDecoration(hintText: "关键字/宝贝标题"),),
          new RaisedButton(child: Text("搜索"), onPressed: null,)
        ],
      ),
    );
    return new ListView(
      children: <Widget>[
        searchSection
      ],
    );

It crashed for the layout width problem

How to change package name in flutter

Hello! How can I create a landscape screen?

I want to play a video in fullscreen landscape mode on the onPress of ListTile.

I believe you can make a container decorator, that when implemented with a custom paint you can draw over other components

but you’d have to reimplement gestures and can’t add widgets when using custom paint

cannot find runner for main.dart….. can anyone help me out!!

I have created all various sizes of an icon now for my app, but where do I put it to change the launcher icon?

u can use android folder and place it in mipmap folders and android manifest file u can change launcher icon @RobertBrunhage

Hey I am new to flutter. I am getting this error after upgrade flutter

compiler message: lib/Dashboard.dart:951:29: Error: A value of type ‘dart.core::String’ can’t be assigned to a variable of type ‘dart.core::int’.
compiler message: Try changing the type of the left hand side, or casting the right hand side to ‘dart.core::int’.
compiler message: photo = favUrls[index1][‘featured_img’];
compiler message: ^

could you please help me here?

List<List> favUrls = [];

var photo = favUrls[index1][‘featured_img’]; favid = favUrls[index1][‘ID’];

@AshokVonteddu Thanks, got it working! :)

Not just 2 lines show the complete Class….

Welcome :smile: @RobertBrunhage

I need some help, I have a network image in my profile, the weird thing is that it downloads the image multiple times depending on which bottomnavigation I select:

new FadeInImage.memoryNetwork(
                  placeholder: kTransparentImage,
                  image: profilePictureUrl,
                  fit: BoxFit.cover,
                ),

So first it loads when I start the app, then it loads each time I enter a different bottomnavitem ex: my home feed or new feed. This is making my firebase storage read quata get reached really fast on only 1-2 images top. Anyone got any idea on how to fix this?

I only want that to be called when I am actually inside the profile and not in another tab of the bottomnavbar

To upgrade my app’s flutter version to Beta 3 i should change to the dev channel?

Should the app behave like this? because I don’t want it to run my ui code in profile when I navigate to new feed or any other tab. This runs my network image on everyplace I use it which eats up my read on firebase storage whiting 2 hours of developing…

I’m working on app where above Camera view I need to show something. But, whenever I’m trying to build app I’m getting these errors…

I/flutter ( 6911): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 6911): The following NoSuchMethodError was thrown building CameraApp(dirty, state: _CameraAppState#b6034):
I/flutter ( 6911): The getter 'value' was called on null.
I/flutter ( 6911): Receiver: null
I/flutter ( 6911): Tried calling: value

Here, is my Stackoverflow post link — https://stackoverflow.com/questions/50304502/flutter-app-error-getter-value-was-called-on-null

There are 2 solutions available to ur problem.
1) Save most often used image on File.
2) Use image caching library

@hackerhgl The problem isn’t about me downloading a file I want, It is that it does it when I don’t want it to.

This is my home which holds my navigations etc:

new Stack(
          children: <Widget>[
            new Offstage(
              offstage: Home.index != Constants.HOME,
              child: new TickerMode(
                enabled: Home.index == Constants.HOME,
                child: new HomeFeed(),
              ),
            ),
            new Offstage(
              offstage: Home.index != Constants.NEW,
              child: new TickerMode(
                enabled: Home.index == Constants.NEW,
                child: new NewFeed(),
              ),
            ),
            new Offstage(
              offstage: Home.index != Constants.UPLOAD,
              child: new TickerMode(
                enabled: Home.index == Constants.UPLOAD,
                child: new UploadFeed(),
              ),
            ),
            new Offstage(
              offstage: Home.index != Constants.FAVORITES,
              child: new TickerMode(
                enabled: Home.index == Constants.FAVORITES,
                child: new HomeFeed(),
              ),
            ),
            new Offstage(
              offstage: Home.index != Constants.PROFILE,
              child: new TickerMode(
                enabled: Home.index == Constants.PROFILE,
                child: new ProfileFeed(),
              ),
            ),
          ],
        ),

All of these: HomeFeed(), NewFeed(), ProfileFeed() etc etc is all getting called when I open the app and all of them are called when I navigate to one of them, instead of only running the one I navigate to…

Do you mean all your Feeds are rendered when you open the app?

yeah and all of them a rendered when I press on one of them also. So pretty much all of them are rendered each time I open the app and each time I navigate with the bottomnavbar

            new Offstage(
              offstage: Home.index != Constants.PROFILE,
              child: new TickerMode(
                enabled: Home.index == Constants.PROFILE,
                child: Home.index == Constants.PROFILE ? new ProfileFeed() : new Container(child: null),
              ),
            ),

@hackerhgl Thanks! It seems like that is working, will test it out more while developing but I think that did the trick, Thanks so much!

@hackerhgl It seems like the state is gone now though because I replace them with a empty container :/

so in the new feed it will have 10 posts but if I navigate to profile and then back I need to download those 10 posts again

If you wanna preserve State Then

Class FeedPage {
 [State Logic]

 Build() {
  if (enabled) 
    return Page;
 } else
    return new Container(child: null);

}

With this logic your state will be preserved & your dom will be empty.

@hackerhgl Sorry, haven’t done that before. Could you give a more detailed example?

            new Offstage(
              offstage: Home.index != Constants.PROFILE,
              child: new TickerMode(
                enabled: Home.index == Constants.PROFILE,
                child: new ProfileFeed(enable: Home.index == Constants.PROFILE),
              ),
            ),

pass the “enable” parameter in every Object

Then See the change in my edited file.

What should I do with the final firebase app variable?

Well i don’t known how you design the architecture.
Now you have to figure out that part.

It seems to only render what I have in the HomeFeed() and not the others

Yeah but when I navigate to profileFeed() it won’t render the profileFeed at all because enable bool is false

does “Home.index” change when you navigate to other FeedScreen

Yeah I added a breakpoint and it seems that it returns true on the one I navigate to but then inside that class it says false on the enable var

could it be anything with the enable variable being final and won’t change to true?

because when I first run the app all classes will have false except homefeed

Yup, you can’t change the value of final variable…

changed it to without final but still it seems that it is passing true to the profile constructor but still says false on enable

child: new ProfileFeed(enable: Home.index == Constants.PROFILE), //says true here on breakpoint

but

_ProfileFeedState({this.enable}); //Says false here on breakpoint

Any body help me out with this issue?

Its Because you preseves the state Thats why new Objects aren’t created….

when u navigates to other feed screen you’re still getting Object Initialized.

but it’s nothing to preserve because it never once runs the code to generate the UI because it always returns the container with null child

you have design your code differently.

hello, buttom navigationBar is kinda too big hw do i adjust its size

I have a ListView builder where I have some items that i can increment or decrements some values, how can i preserve the state of the actions in the ui because when I scroll the list all items out of view gets reset (I have the data but I am asking about preserving the state of the ui)

i am not able to select device in Android Studio.

Have you tried restarting your PC?

Capture.PNG

what is the output if you do adb devices -l in a shell?

it lists recognized devices

how to add dart project in Android Studio

just open the directory that contains pubspec.yaml

its in intellij, not in Android Studio.

Should be pretty much the same

its showing only to add a flutter project in Android Studio.

Trying to learn about global key but when I try this profileKey.currentState.changeEnabled(true); it says that currentState is null

«Open an existing Android Studio Project» should work

image.png

What’s wrong with this…

import 'dart:async';
import 'package:flutter/material.dart';
import 'package:camera/camera.dart';

List<CameraDescription> cameras;

Future<Null> main() async {
  cameras = await availableCameras();
  runApp(new MaterialApp(
    home: new CameraApp(),
  ));

}

class CameraApp extends StatefulWidget {
  @override
  _CameraAppState createState() => new _CameraAppState();
}

class _CameraAppState extends State<CameraApp> {
  CameraController controller;

  @override
  void initState() {
    super.initState();

    controller = new CameraController(cameras[0], ResolutionPreset.medium);
    controller.initialize().then((_) {
      if (!mounted) {
        return;
      }
      setState(() {});
    });
  }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {

    // camera widget
    Widget cameraView = new Container(
      child: new Row(children: [
          new Expanded(
            child: new Column(
                children: <Widget>[
                  new AspectRatio(
                    aspectRatio: (controller.value.aspectRatio) ,
                    child: new CameraPreview(controller)
                  )
                ]
            ),
          )
      ])
    );

    return new Scaffold(
      body: new Stack(
        children: <Widget>[
          (!controller.value.initialized) ? new Container() : cameraView,

           // ---On top of Camera view add one mroe widget---

        ],
      ),
    );
  }
}

I’m getting following errors…

I/flutter ( 2097): The following NoSuchMethodError was thrown building CameraApp(dirty, state: _CameraAppState#a0666):
I/flutter ( 2097): The getter 'height' was called on null.
I/flutter ( 2097): Receiver: null
I/flutter ( 2097): Tried calling: height

How do I run a function from another class? When I use key.currentstate it returns null

@zoechi there is no exact solutions in these links.

hey guys, do you know how to do outset border shapes? basically I want to have a bottom app bar with two «ramps» going up, instead of down, like in the I/O example

good morning everyone! I’m trying to debug my app, and the breakpoints aren’t stopping at certain places. It is because they’re in an async function? The function appears to be working, but debugPrint statements within it aren’t printing.

@axmccx Do you have any idea ho can I import images from firebase in the Storage?

@nassimbjf sorry, I don’t know. I haven’t touch any of the Storage stuff yet, just learning the Auth and firestore right now.

Hi Everyone. Would Like to know if there is a problem with firebase_auth 0.5.9 + firebase_storage 0.3.4 + pod 1.5.2 with iOs and some deprecated functions/properties?

Does anyone knows how to import images from firebase in the Storage

@axmccx hello Alex. DO you have any problem? are you using an iOs Emulator?

@ramah you mean warnings like these?
Launching libmain.dart on Android SDK built for x86 in debug mode…
Initializing gradle…
Resolving dependencies…
Running ‘gradlew assembleDebug’…
Configuration ‘compile’ in project ‘:app’ is deprecated. Use ‘implementation’ instead.
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
Note: C:Program Filesflutter.pub-cachehostedpub.dartlang.orgcloud_firestore-0.5.1androidsrcmainjavaioflutterpluginsfirebasecloudfirestoreCloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:Program Filesflutter.pub-cachehostedpub.dartlang.orgfirebase_core-0.2.3androidsrcmainjavaioflutterpluginsfirebasecoreFirebaseCorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

I get them all the time, doesn’t seem to hurt, I’m not worried about them

@axmccx I have some warnings but errors are my main problems ex : …/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.3.4/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java:264: warning: [deprecation] getDownloadUrl() in UploadTask.TaskSnapshot has been deprecated
result.success(snapshot.getDownloadUrl().toString());

@ramah these errors prevent you from running your project?

yes they prevent me from running my project

@nassimbjf ahah, yeah, I would pick that apart :p

@ramah that’s odd, I wouldn’t expect a deprecation warning to cause a build failure

You sure that’s the cause?

pub-cache/hosted/pub.dartlang.org/firebase_storage-0.3.4/ios/Classes/FirebaseStoragePlugin.m:190:43: error: property ‘downloadURL’ not found on object of type ‘FIRStorageMetadata
NSURL
downloadURL = metadata.downloadURL;

@axmccxtrying to find the cause. But no lock soo far

do you use any objects of type FIRStorageMetadata and are trying to downloadURL on it?

In fact i’ just added in the pubspec.yaml those line and compilation failed

google_sign_in: ‘^2.1.0 ‘
firebase_auth: ‘0.5.9’
firebase_core: ‘^0.2.3’
firebase_database: ‘0.4.6’
firebase_storage: ‘0.3.4’

and you’re adding the appropriate imports?

I think that if the project did not build no need to imports theme in dart files?

uh, pretty sure you need to import what you’re using

@ramah Try to remove the ‘^’ arrow on all of them and then try to decrease the versions one by one to see if that is faulty

happened to me 2 days ago

Thank you for your help :)

Hi everyone, is anyone here familiar with scoped_models? I need some help, and its very urgent

Hi!
I have a custom StatefulWidget inside a TabBarView how do I preserve its status when I change tab.
I used a PageStorageKey and it keeps the scrolling position but it loses everytime the state of my custom StatefulWidget.

What Flutter version are you using

please post the output of flutter doctor

hey there, i have a cloud firestore connection, but changes only take effect on «Text» elements. Icons won’t change. Is there something to be implemented to notify the Icons to be redrawed?

Can I use Image.asset() as a placeholder for FadeInImage.memoryNetwork() ?

Does anyone know how to get the bytes from an Image.asset?

@zoechi hello and thx Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.3.2, on Mac OS X 10.13.4 17E202, locale en-GB)
[✓] Android toolchain — develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain — develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.3)
[✓] Connected devices (2 available)

• No issues found!

@zoechi and errors are lutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.0/ios/Classes/FirebaseAuthPlugin.m:157:43: error: incompatible block pointer types sending ‘void (^)(FIRUser __strong, NSError strong)’ to parameter of type ‘FIRAuthDataResultCallback _Nullable’ (aka ‘void (^)(FIRAuthDataResult * _Nullable strong, NSError _Nullable __strong)’)
completion:^(FIRUser
user, NSError *error) {

/Users/ramah/Work_Items/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.5/ios/Classes/FirebaseAuthPlugin.m:113:37: error: incompatible block pointer types sending ‘void (^)(FIRUser __strong, NSError strong)’ to parameter of type ‘FIRAuthDataResultCallback _Nullable’ (aka ‘void (^)(FIRAuthDataResult * _Nullable strong, NSError _Nullable __strong)’)
completion:^(FIRUser
user, NSError *error) {

/Users/ramah/Work_Items/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.5.5/ios/Classes/FirebaseAuthPlugin.m:93:41: error: incompatible block pointer types sending ‘void (^)(FIRUser __strong, NSError strong)’ to parameter of type ‘FIRAuthDataResultCallback _Nullable’ (aka ‘void (^)(FIRAuthDataResult * _Nullable strong, NSError _Nullable __strong)’)
completion:^(FIRUser
user, NSError *error) {

How can I access methods and setstate of another class in another file?

@zoechi please my tabs recreate and reloads the data in it each time I navigated to and fro a new tab, is there anyway to fix it?

Hi guys How can I load images from firebase

@nassimbjf Do you have the url of the image?

@RobertBrunhage Have you uploaded the image?

I want to use my own images

I uploaded images in firebase storage

this is the code I use to upload to firebase storage:

    var uuid = new Uuid();
    FirebaseUser user = await FirestoreUtil.getUid();
    User userObject = await FirestoreUtil.downloadUser(user.uid);
    final StorageReference ref = FirebaseStorage.instance.ref().child(user.uid + "/"+ uuid.v1().toString());
    final StorageUploadTask uploadTask = ref.put(imageFile);
    final Uri downloadUrl = (await uploadTask.future).downloadUrl; //Uploads to FirebaseStorage

Where I should paste this?

as you can see I am getting a downloadUrl which I can put in a networkimage or upload to firestore/realtime database

@nassimbjf How does your code look like when you upload an image?

I am trying to replace those images with my own

Do you uploaded the image to the storage with code or have you done it manually?

If you go into storage in firebase and press on the name of the image. To the right you will see a small image of the one you have uploaded right?

in the file location dropdown you can find a download url

which can be copied into a Image.network

Does anyone know how to preserve the state of ui when scrolled out of view in a ListView ?

@RobertBrunhage This code is to upload to firebase right ?
var uuid = new Uuid();
FirebaseUser user = await FirestoreUtil.getUid();
User userObject = await FirestoreUtil.downloadUser(user.uid);
final StorageReference ref = FirebaseStorage.instance.ref().child(user.uid + «/»+ uuid.v1().toString());
final StorageUploadTask uploadTask = ref.put(imageFile);
final Uri downloadUrl = (await uploadTask.future).downloadUrl;

‘ var uuid = new Uuid();
FirebaseUser user = await FirestoreUtil.getUid();
User userObject = await FirestoreUtil.downloadUser(user.uid);
final StorageReference ref = FirebaseStorage.instance.ref().child(user.uid + «/»+ uuid.v1().toString());
final StorageUploadTask uploadTask = ref.put(imageFile);
final Uri downloadUrl = (await uploadTask.future).downloadUrl; ‘

@nassimbjf That code is specific to my project because I have created my own classes

but the 3 last lines work

@axmccx @zoechi No evolution. Now folllowing the tutorial for flutter and firebase I have this self->
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:351:26: error: unknown receiver ‘FIRSetOptions’; did you mean ‘FIROptions’?
options:[FIRSetOptions merge]
^~~~~
FIROptions
In file included from futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:7:
In file included from folderpath/ios/Pods/Headers/Private/Firebase/Firebase.h:1:
In file included from folderpath/ios/Pods/Headers/Private/FirebaseCore/FirebaseCore.h:21:
folderpath/ios/Pods/Headers/Private/FirebaseCore/FIROptions.h:25:12: note: ‘FIROptions’ declared here
@interface FIROptions : NSObject <NSCopying>
^
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:351:40: error: no known class method for selector ‘merge’
options:[FIRSetOptions merge]
^~~~~
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:350:17: error: no visible @interface for ‘FIRDocumentReference’ declares the selector ‘setData:options:completion:’
[document setData:call.arguments[@»data»]

       ~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:440:76: error: unknown receiver 'FIRSetOptions'; did you mean 'FIROptions'?
      [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];
                                                                           ^~~~~~~~~~~~~
                                                                           FIROptions
In file included from futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:7:
In file included from folderpath/ios/Pods/Headers/Private/Firebase/Firebase.h:1:
In file included from folderpath/ios/Pods/Headers/Private/FirebaseCore/FirebaseCore.h:21:
folderpath/ios/Pods/Headers/Private/FirebaseCore/FIROptions.h:25:12: note: 'FIROptions' declared here
@interface FIROptions : NSObject <NSCopying>
           ^
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:440:90: error: no known class method for selector 'merge'
      [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];
                                                                                         ^~~~~
futtlersdkpath/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.0+2/ios/Classes/CloudFirestorePlugin.m:440:14: error: no visible @interface for 'FIRWriteBatch' declares the selector 'setData:forDocument:options:'
      [batch setData:call.arguments[@"data"] forDocument:document options:[FIRSetOptions merge]];

What about just loading the images

@nassimbjf You just take the Url as I said before and you put it in the Image.network() widget

Screen Shot 2018-05-12 at 10.46.26 PM.png

How to disable Hardware button space in android

@RobertBrunhage Do you have any idea how can I create my own Package?

Hello I’m looking for a working set of firebase/plugins building for an ios application (auth + storage + database) thx

a working pubspec.yaml file. and the cocoapods version please

I’m trying to use AsymmetricView

should I create it as a function or what?

Flutter NEWBIE here, I built a little sample app and ran it on iOS Simulator but it looks like Material Design, is there a simple way to make it look like an iOS app? Thank sin advance!

I am trying to build something like this

    body: AsymmetricView(proctus:getProducts(Category.all)),

AsymmetricView is not defined

Do you have android studio installed?

I thought it was added by it

check C:Users<username>.android

sorry, missing after the username, you know what i mean :)

there should be a file called debug.keystore there

yeah, so just change the part of the command «%USERPROFILE%.androiddebug.keystore»

to the full path of the file

%USERPROFILE% wasn’t working for me

The constructor returns type ‘dynamic’ that isn’t expected type ‘Widget’

Anyone found a way to force Android Studio Flutter extension to create Dart 2 boiler plate from shortcuts such as «stful»?

i’m getting these error when i’m running a app……any help ?

if it start typing stf I can hit enter and the boilerplate gets added

@axmccx thank you very much

@Donistivanov you’re very welcome :)

does it create Dart 1 style code? i.e. return new Container(); in the Widget build

Hi, I’m trying to code the following in flutter:
https://goo.gl/rGjU82
The code used here does not contain ‘new’ keyword, however my program requires me to use new keyword everywhere. Can anyone help?

when I run my app, the emulator goes straight to «app» has stopped working. Android studio’s console shows no errors, the Flutter inspector opens up and no signed of any problems. Does anyone have any advice on how to debug this?

@ashwanth1109 I’m pretty sure the new keyboard is now optional

please how do i retain my appstate when i navigate to a new tab?

it totally recreates the state

@axmccx , my Android Studio is at the latest version, but it still expects the new keyword… the error message im getting is ‘function not defined’. Any clue on where Im going wrong?

make sure everything is up to date

run the command flutter doctor

maybe function isn’t actually defined, maybe you’re missing the import

image.png

image.png

I have imported material.dart package

@ashwanth1109 File -> Settings -> Languages & Frameworks -> flutter -> ‘Run application in Dart 2.0’ enable dart 2.0

@axmccx
please how do i retain my appstate when i navigate to a new tab?
it totally recreates the state

@ashwanth1109 mine, Flutter version 0.3.2, yours is 0.0.21? try running the command flutter upgrade

@mtellect I don’t really know where to start

I’m learning redux right now, it seems to have loads of promise with making managing state easier

Does anyone have any advice with how to debug an app that crashes immediately? Just goes straight to app has stopped, no errors anywhere in android studio. I’d rather not start commenting out all my changes to look for the cause :/

This messed up, it just launched now, wtf

@RobertBrunhage , I updated my settings in flutter to enable dart 2.0, so now my app is running successfully but I still get errors for not using new keyword.
Then I updated as per @axmccx instructions and the errors are all gone, so thanks guys :)
@axmccx @RobertBrunhage

@ashwanth1109 glad to hear it! :)

@RobertBrunhage and I’ll try breakpoints next time. I was pretty sure I had tried that last time and it made no difference

@nassimbjf AsymmetricView is not a widget from the Flutter framework, it looks like something they put together for that demo/codelab, have you checked if it’s in the codelab repo/files?

@axmccx try to systematically place out break point from your application start and deeper in to the app depending on what kind of app

I’m just glad it’s running and working now :)

@axmccx Ohh didn’t see you got it working, nice!

yeah! it just started working again out of nowhere, that’s what’s frustrating

@axmccx If it happens again:
Try doing a flutter clean before flutter run.
Try running flutter run -v for verbose mode which might have more errors logged
Try checking adb logcat for an error on the android side that never shows up in the flutter logs

thanks for the suggestions @xqwzts I’ll try next time it happens

@mtellect What app state are you trying to retain?

i have 4tabs say «A, B, C, D» with data in each, when you move from A to B or A to C, the state is lost, kinda like the widget is rebuilt

The widget is rebuilt each time

If you want to maintain state you can either:

  • Tell flutter to save this widget’s state [using a PageStorageKey]
  • Or hold the state somewhere externally, and have the widget be a UI that looks up that state.

flutbot docs pagestoragekey

A RenderFlex expected a child of type RenderBox but received a child of type RenderSliverPadding.

Can anybody give some help with slivers ? What are they, how do they work ? I am having a lot of trouble with them and I can’t wrap my head around them.

@radiKal07 Any specific question about them?

@xqwzts What does my error actually mean ?

Did you try to place a SliverPadding widget somewhere that isn’t a CustomScrollView?

Slivers are widgets that can be placed as slices in a scrollable container

Usually you’d use them indirectly: ListView and GridView are slivers

Or if you’re using them directly then you’re probably making a CustomScrollView

The error message above indicates that you’ve placed a Sliver in a non-sliver parent.

I have a CustomScrollView and inside it I put 3 SliverToBoxAdapter items and one SliverPadding which has as a child a SliverList

[The non-scrollable widgets are boxes (inherting from RenderBox), the scrollable ones are Slivers]

Are you sure your SliverPadding isn’t nested in a non-sliver widget?

Could you share a snippet?

Hello @FilloPalma_twitter

I have a problem with drawer

That depends on the question, but feel free to just ask it, and hopefully someone with an answer will come along :)

I have drawer inside statefulwidget

Have you placed the drawer in a Scaffold?

@mtellect Where do you call the classes? because I simply fixed the issue with doing ‘final HomeFeed _homeFeed = new HomeFeed();’ in the class that holds my navbar and then using _homeFeed instead of doing new HomeFeed() each time I go to the tab.

@RobertBrunhage let me try this out

@marica27 Thank you , is it legal to use it right?

@xqwzts I got it. I was using a ListView inside a CustomScrollView. I replaced the ListView with Column and it works. Thanks for your time. I really appreciate you investing your time in helping the community.

@radiKal07 The silver equivalent of ListView is SliverList

Yes, but SliverList was not working also, maybe because it was inside a non-sliver parent.

Hmm, a CustomScrollView is a sliver parent though

someone use drawer inside statefullwidget ?

do you guys put your Google Functions code in the same project folder as flutter?

@RobertBrunhage ..didn’t work…on page A, and B scroll widget went back to the top

@Donistivanov I have all Firebase server side stuff in a sibling project to my firebase project

I also build a web client therefore doesn’t make sense to bind server stuff so tight to the Flutter project

@zoechi I have 4 tabs «A,B,C,D» each has data being loaded from the db @initstate, now when I move from A to B or either tabs , the widgets in all are recreated , how can I stop t?

@zoechi hmm makes sense. Thanks!

I am using the ButtomNavigationBar with IconButtons In It, hw can I adjust its height, its too big OR I can’t do that?

Can I link to flutter apps with one firebase?

can I link two flutter apps with one firebasE?

I’m trying to create cloud firestore but I get this error

Cannot enable Firestore for this project
An unknown error occurred

@norbertkross why not simply use a Row of IconButtons? wrap it with a Container with your own height set.

@nassimbjf yes you can link many apps to one Firebase.

then save the Android JSON or iOS plist file for your project.

Во вновь созданном проекте я не могу публиковать какие-либо изменения в правилах Firebase. Даже простые изменения, такие как добавление новой строки в конец файла или добавление пробела.

enter image description here

Я чувствую, что это может быть ошибка в Firestore, но решил сначала спросить здесь…

Error saving rules –An unknown error occurred

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false; 
    }
  }
}

4 ответа

Я обнаружил, что причиной этой ошибки для меня было расширение Chrome Allow CORS: Access-Control-Allow-origin. Отключение расширения устранило ошибку.


6

Trystan Rivers
16 Авг 2021 в 10:49

Установите Firebase CLI в командной строке, войдите в CLI firebase, затем откройте файл .rules в своем редакторе (vscode, atom) и замените его на:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

Затем выполните развертывание в firebase из командной строки с помощью этой команды

firebase deploy --only firestore:rules


3

Meyer Frenchel
21 Ноя 2020 в 05:18

Внезапно возникла та же проблема: «произошла неизвестная ошибка» для правил безопасности Firestore. Исправлено, обновив его через интерфейс командной строки Firebase.

Итак, в терминале делаем следующие шаги:

  1. npm install -g firebase-tools
  2. вход в firebase // завершаем процедуру входа в систему

// Настройте Firestore в каталоге вашего проекта, создайте файл .rules

  1. firebase инициализирует магазин огня

// Обновите файл firestore.rules, который вы можете найти в корне каталога.

// Сохраните и разверните файл .rules

  1. firebase deploy —only firestore:rules


1

Yovan
14 Фев 2021 в 17:52

Единственный способ заставить его работать — через CLI, инициализировать его, выбрать существующий проект, который у вас есть, и изменить правила в файле .rules, а затем развернуть их.


0

Adnan Rruka
14 Авг 2021 в 19:40

Sometimes when you’re building an app, things don’t go as planned and an
error occurs!

When in doubt, catch the exception thrown by the function
and see what the error message has to say.

final storageRef = FirebaseStorage.instance.ref().child("files/uid");
try {
  final listResult = await storageRef.listAll();
} on FirebaseException catch (e) {
  // Caught an exception from Firebase.
  print("Failed with error '${e.code}': ${e.message}");
}

Handle Error Messages

There are a number of reasons why errors may occur, including the file
not existing, the user not having permission to access the desired file, or the
user cancelling the file upload.

To properly diagnose the issue and handle the error, here is a full list of
all the errors our client will raise, and how they occurred.

Code Description
storage/unknown An unknown error occurred.
storage/object-not-found No object exists at the desired reference.
storage/bucket-not-found No bucket is configured for Cloud Storage
storage/project-not-found No project is configured for Cloud Storage
storage/quota-exceeded Quota on your Cloud Storage bucket has been exceeded. If you’re on the no-cost tier, upgrade to a paid plan. If you’re on a paid plan, reach out to Firebase support.
storage/unauthenticated User is unauthenticated, please authenticate and try again.
storage/unauthorized User is not authorized to perform the desired action, check your security rules to ensure they are correct.
storage/retry-limit-exceeded The maximum time limit on an operation (upload, download, delete, etc.) has been excceded. Try uploading again.
storage/invalid-checksum File on the client does not match the checksum of the file received by the server. Try uploading again.
storage/canceled User canceled the operation.
storage/invalid-event-name Invalid event name provided. Must be one of [running, progress, pause]
storage/invalid-url Invalid URL provided to refFromURL(). Must be of the form: gs://bucket/object or https://firebasestorage.googleapis.com/v0/b/bucket/o/object?token=<TOKEN>
storage/invalid-argument The argument passed to put() must be File, Blob, or UInt8 Array. The argument passed to putString() must be a raw, Base64, or Base64URL string.
storage/no-default-bucket No bucket has been set in your config’s storageBucket property.
storage/cannot-slice-blob Commonly occurs when the local file has changed (deleted, saved again, etc.). Try uploading again after verifying that the file hasn’t changed.
storage/server-file-wrong-size File on the client does not match the size of the file recieved by the server. Try uploading again.

Во вновь созданном проекте я не могу публиковать какие-либо изменения правил Firebase. Даже простые изменения, такие как добавление новой строки в конец файла или добавление пробела.

Я чувствую, что это может быть ошибка в Firestore, но подумал, что сначала спрошу здесь …

Error saving rules –An unknown error occurred

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false; 
    }
  }
}

Если что-то в консоли работает не так, как вы ожидаете, обратитесь в службу поддержки Firebase напрямую. firebase.google.com/support/contact


— Doug Stevenson

22.11.2018 15:17

Удалось ли вам решить эту проблему?


— Poul Kruijt

27.11.2018 23:18

Я связался со службой поддержки Google, и мы в конце концов заставили ее работать, обновив правила безопасности с помощью интерфейса командной строки Firebase.


— Matt Wlazlo

29.11.2018 02:23

Преимущества и ограничения бессерверной технологии для фронт-энд приложений

Есть ли способ встроить текстовый редактор в HTML-форму?

PHP

Кто такой АУДИТОР смарт-контракта?

REACT и NEXT JS вместе с Tailwind CSS

REACT и NEXT JS вместе с Tailwind CSS

Наличие собственного или персонального сайта необходимо в современном мире, а сочетание React и Next JS позволяет разработчику сделать это за меньшее…

В чем разница между HTML4 и HTML5?

В чем разница между HTML4 и HTML5?

HTML4 и HTML5 — это версии HTML, стандартного языка разметки, используемого для создания веб-страниц. Некоторые из ключевых различий между HTML4 и…


Ответы
4

Установите Firebase CLI в командной строке, войдите в интерфейс командной строки firebase, затем откройте файл .rules в своем редакторе (vscode, atom) и замените его на:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
  }
}

Затем разверните в firebase из командной строки с помощью этой команды

firebase deploy --only firestore:rules

Внезапно возникла та же проблема: «Произошла неизвестная ошибка» для правил безопасности Firestore. Исправлено обновлением через интерфейс командной строки Firebase.

Итак, в терминале проделайте следующие шаги:

  1. npm install -g firebase-tools
  2. firebase login // завершаем процедуру входа в систему

// Настраиваем Firestore в каталоге вашего проекта, создает файл .rules

  1. firebase init firestore

// Обновляем файл firestore.rules, который вы можете найти в корне каталога.

// Сохраняем и развертываем ваш файл .rules

  1. firebase deploy —only firestore: rules

Единственный способ заставить его работать — это через интерфейс командной строки, инициализировать его, выбрать существующий у вас проект и изменить правила в файле .rules, а затем развернуть их.

Я обнаружил, что расширение Allow CORS: Access-Control-Allow-origin Chrome было для меня причиной этой ошибки. Отключение расширения устранило ошибку.

Другие вопросы по теме

Понравилась статья? Поделить с друзьями:
  • Cannot display this video mode change computer display input to 1920x1080 60hz как исправить
  • Cannot display this video mode change computer display input to 1280x1024 60hz как исправить
  • Cannot determine a valid java home ошибка как исправить
  • Cannot create windows service for mysql error 0
  • Cannot create rpcs3 log access denied как исправить