简体   繁体   中英

Unexpected end of input error when configuring with flutterfire

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>

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.

Hellos, 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

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

  2. Re-run the flutterfire configure command

  • flutterfire configure

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM