• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Flutter 게시판 flutterfire configure에서 ERROR

flutterfire configure에서 ERROR

8 글 보임 - 1 에서 8 까지 (총 8 중에서)
  • 글쓴이
  • #29277

    한준규
    참가자

    강의 절차대로 flutterfire configure을 했는데 해당 오류가 뜹니다.

    editor 재시작도 해보고, 컴퓨터 재시작도 해보고. dart pub global deactivated flutterfire_cli 도 하고 다시 해보고,

    또 해당 ERROR 구글링해서 https://firebase.google.com/docs/cli#install_the_firebase_cli 해당 사이트에서 하라는 대로

     독립 실행형 바이너리 설치도 해봤습니다. (node.js에 문외해서 그쪽 방법을 선택했습니다.)

    또 안되서 구글링 더해보니 https://stackoverflow.com/questions/70410843/firebasecommandexception-an-error-occured-on-the-firebase-cli-when-attempting-t 여기서 저 exe파일을 firebase.exe로 renaming하고 project 폴더에 넣어라길래 넣었더니 firebase 명령어들은 project 수준의 terminal에서 잘 작동하지만, 강의와 다르게 firebase_options.dart 같은 파일도 생성이 안된 것 같고 따라가기 어렵겠다는 생각이 들었습니다.

    말고도 firebase package 공식문서대로 이것저것 문서에 추가해도 안되네요...

    버전이 최근 업데이트된 버전 쓰고 있어서(2.10.3 최근 업데이트를 또 해서) 버전 때문에 firebase랑 연동에 문제가 있나해서 2.8.0 다운그레이드 하고 시도해봤는데도 안되네요 

    그래서 혹시 뭔가 처음에 잘못됐거나 너무 많은 방법을 시도하면서 파일이 더러워졌나 해서 :C\Users\user\ 에 있는 최근 수정된 firebase 관련 문서들 전체 삭제하고 새 프로젝트 생성한 후 시도하는데도 잘 안됩니다.

    꽤 많은걸 거의 이틀에 걸쳐 시도해본 것 같은데도 여전히 아래와 같은 똑같은 에러를 반환하네요.. 무엇이 문제일까요?
    C:\Users\user\Desktop\Flutter\silverco>flutterfire configure
    'git'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
    배치 파일이 아닙니다.
    Building flutter tool...
    Running pub upgrade...
    Building package executable...
    Built flutterfire_cli:flutterfire.
    i Found 0 Firebase projects.
    FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
    COMMAND: firebase --version
    ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it.

    #29291

    codingapple
    키 마스터

    nodejs 검색해서 lts 버전 다운받아 설치하고

    터미널 아무데서나 띄워서 npm install -g firebase-tools 해보면 됩니다 

    #29295

    한준규
    참가자

    nodejs 설치후 해당 코드 입력해서 터미널에서 성공적으로 동작했습니다.

    이후  flutterfire configure 입력해도 발생하는 오류는 계속됩니다.

    에디터 끄고 다시 해봐도 이전 글에 작성했던 에러와 같은 메세지를 반환합니다.

    (firebase 관련 명령어들도 전체적으로 동작하지 않습니다. firebase login 같은거)

    #29309

    codingapple
    키 마스터

    npm으로 설치하고 프로젝트 폴더에 firebase.exe 파일넣고 해보면 잘된다는 소리가 있군요 

    firebase console에서 프로젝트도 잘 만들고 환경변수도 잘 등록했나요 

    터미널에 firebase login 치면 무엇이 나옵니까 

    #29321

    한준규
    참가자

    npm으로 flutterfire_cli 설치후에 독립 실행형 바이너리 exe파일 firebase.exe로  rename해서 project 파일에 담은 후에 flutterfire configure 커맨드 했으나 아래와 같은 오류 발생했습니다. 

    firebaseconsole에서 프로젝트 및 앱도 설명대로 설치했고, 환경변수도 처음 activate flutterfire_cli 할 때 등록해줬습니다.

    <em>⠸ Fetching available Firebase projects...</em>
    <em>Unhandled exception:</em>
    <em>FormatException: Unexpected character (at character 1)</em>
    <em>#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1405:5)</em>
    <em>#1 _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1272:9)</em>
    <em>#2 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:937:22)</em>
    <em>#3 _parseJson (dart:convert-patch/convert_patch.dart:40:10)</em>
    <em>#4 JsonDecoder.convert (dart:convert/json.dart:506:36)</em>
    <em>#5 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)</em>
    <em><asynchronous suspension></em>
    <em>#6 getProjects (package:flutterfire_cli/src/firebase.dart:114:7)</em>
    <em><asynchronous suspension></em>
    <em>#7 ConfigCommand._selectFirebaseProject (package:flutterfire_cli/src/commands/config.dart:159:24)</em>
    <em><asynchronous suspension></em>
    <em>#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:227:37)</em>
    <em><asynchronous suspension></em>
    <em>#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)</em>
    <em><asynchronous suspension></em>
    <em>#10 main (file:///C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.1.1+2/bin/flutterfire.dart:34:5)</em>
    <em><asynchronous suspension></em>
    혹시나 json파일 뭐라뭐라 돼있길래 google-services.json 파일 android/app 디렉토리에 넣고도 해봤는데 실패했습니다.

    firebase login 명령 실행 시에도 아래와 같은 오류가 뜹니다.

    <em>SyntaxError: Unexpected end of JSON input</em>
    <em>at JSON.parse (<anonymous>)</em>
    <em>at ChildProcess.<anonymous> (C:\snapshot\firepit\welcome.js:115:27)</em>
    <em>at ChildProcess.emit (events.js:315:20)</em>
    <em>at maybeClose (internal/child_process.js:1021:16)</em>
    <em>at Socket.<anonymous> (internal/child_process.js:443:11)</em>
    <em>at Socket.emit (events.js:315:20)</em>
    <em>at Pipe.<anonymous> (net.js:674:12)</em>
    원래 에러 해결 초기에 독립 실행형 바이너리에서 firebase loign 잘 작동했었고 프로젝트 파일에 넣었을 때도 firebase login 잘 작동했었습니다. 그런데 강좌에서의  firebase_options.dart 파일은 flutterfire configure을 통해서 생성되는 듯 해서 저 명령어를 성공시키는 과정에서 계속 어려움을 겪는 것 같습니다.

    flutter 관련 파일들을 완전히 초기화 시키고 진행해야할까요? (flutter 프로젝트는 새로 해봤습니다. version도 바꿔보고, 그런데 파일을 깔끔하게는 못지웠지 않을까 하는 마음이 있습니다.)

    #29360

    codingapple
    키 마스터

    https://github.com/codingapple1/fluttergram

    이거 다운받아서 이걸로 프로젝트 옮기면 될듯요

    flutter pub get 터미널에서 실행하고 firebaseoptions.dart 안에있는 것만 본인 firebase console에 있던 설치코드로 바꿉시다 

    #111869

    이지민
    참가자
    안드로이드나 web의 경우 설치코드를 변경할 수 있었으나 ios의 경우 api키를 어떻게 찾아야 할지 모르겠습니다. 
    윈도우 환경입니다. 어떻게 하면 설치코드를 변경할 수 있을까요?
    #111889

    codingapple
    키 마스터
    firebase options.dart 파일 안에 api키 3개 다 있을걸요
8 글 보임 - 1 에서 8 까지 (총 8 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠