skip to Main Content

I’ve been trying to integrate firebase into my flutter project, however I continually get this error when running the flutterfire configure script. The script runs when it is just ios, but not android.

I’ve blanked out specific identifiers with ////////

    % flutterfire configure
i Found 1 Firebase projects.                                                                                             
✔ Select a Firebase project to configure your Flutter application with · //////////// (////////)                             
✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios                   
i Firebase android app com./////./// registered.                                                                    
i Firebase ios app com./////./// registered.                                                                   
Unhandled exception:
FormatException: Unexpected end of input (at character 1)

^

#0      _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1      _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:501:7)
#2      _parseJson (dart:convert-patch/convert_patch.dart:36:10)
#3      JsonDecoder.convert (dart:convert/json.dart:612:36)
#4      FirebaseAndroidOptions.projectIdFromFileContents (package:flutterfire_cli/src/firebase/firebase_android_options.dart:29:29)
#5      FirebaseAndroidGradlePlugins.applyGoogleServicesPlugin (package:flutterfire_cli/src/firebase/firebase_android_gradle_plugins.dart:101:50)
<asynchronous suspension>
#6      FirebaseAndroidGradlePlugins.apply (package:flutterfire_cli/src/firebase/firebase_android_gradle_plugins.dart:240:5)
<asynchronous suspension>

2

Answers


  1. Chosen as BEST ANSWER

    Solved by rebuilding the flutter application with a different file name. Don't know the exact problem, but this is my personal solution after trying everything else.


  2. I fixed this error by the following steps:

    1. Uninstall and Re-install or Update flutterfire via these commands

      • dart pub global deactivate flutterfire_cli

      • dart pub global activate flutterfire_cli

    2. Delete the google_services.json file in the
      [project_folder]/android/app directory.

    3. Re-run the flutterfire configure command

      • flutterfire configure
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search