Closed leo-neon closed 8 months ago
@leo-neon Hi. Have you tried with previous version of firebase or flutterfire_cli?
Hi @hwr12 , I tried out a few older versions now. All of them with the same error unfortunately. I am really wondering why it once worked before. As if the Google-Services.json has somehow become corrupt. But downloading it manually works und the file looks normal - like a valid JSON. The JSON Decoder under the hood fails.
@leo-neon I had same issues with you. I also haven't find any solution so what I did is to setup firebase in a native way. In android you could just place Google-Service.json in the android/app folder. You can set it in Ios as well in a native way.
This is indeed a serious bug, I don't know why it hasn't been fixed for so long.
This was a problem with the Firebase CLI that has now been fixed in the current version. Please install the latest Firebase CLI via npm i -g firebase-tools
. I would also encourage you to use the latest FlutterFire version:
dart pub global activate flutterfire_cli 0.3.0-dev.18 --overwrite
Is there an existing issue for this?
CLI Version
0.2.7
Firebase Tools version
11.20.0
Flutter Doctor Output
[✓] Flutter (Channel stable, 3.3.6, on macOS 13.1 22C65 darwin-arm (Rosetta), locale en-DE) • Flutter version 3.3.6 on channel stable at ... • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6928314d50 (3 months ago), 2022-10-25 16:34:41 -0400 • Engine revision 3ad69d7be3 • Dart version 2.18.2 • DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at ...../Library/Android/sdk • Platform android-33, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3
[✓] Android Studio (version 2021.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[✓] VS Code (version 1.74.3) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.58.0
[✓] Connected device (1 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.1 22C65 darwin-arm (Rosetta)
[✓] HTTP Host Availability • All required HTTP hosts are available
• No issues found!
Description
I try to flutterfire configure my project but it seems that the Google-Services.json is too long. It is a Firebase Project with a lot of apps added. It succeeds when I use a firebase project with fewer apps.
This is the stack trace: Unhandled exception: FormatException: Unterminated string (at line 5, character 65458) ...
^
0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
1 _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:494:9)
2 _parseJson (dart:convert-patch/convert_patch.dart:36:10)
3 JsonDecoder.convert (dart:convert/json.dart:612:36)
4 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)