Flutter build error "File google-services.json is missing"

android
flutter
#1

Get the following error running the Flutter Build task:

Execution failed for task ‘:app:processReleaseGoogleServices’.
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/vagrant/git/android/app/src/nullnull/release/google-services.json
/Users/vagrant/git/android/app/src/release/nullnull/google-services.json
/Users/vagrant/git/android/app/src/nullnull/google-services.json
/Users/vagrant/git/android/app/src/release/google-services.json
/Users/vagrant/git/android/app/src/nullnullRelease/google-services.json
/Users/vagrant/git/android/app/google-services.json

  • I’ve added the the google-services.json to the GENERIC FILE STORAGE, which generated the url key
  • Added a Google Deploy task after the Flutter Build task
  • Added the URL KEY to Service Account JSON key file path.

Not sure which steps I should be taking next. I need the google-services.json for the flutter maps package.

Hope you can help me. Thanks!

0 Likes

#2

It seems that you have confused 2 different JSON files.
google-services.json (downloaded from Firebase console) must be present as a file on build machine at the time of executing gradle task. If you want to store it on Bitrise you have to download it before invoking step executing gradle tasks eg. using File Downloader or Generic File Storage steps. However, you can also just have this file stored in repository with source code (its content can be effectively retrieved from app).
Google deploy step on the other hand requires different file (key of service user generated in Google API console). It should not be stored in repo and Google deploy step handles downloading automatically, you don’t need to have any other steps.

0 Likes

#3

Hi Koral,

Thanks for the fast reply, and clear answer. Downloading the file worked. Thanks again!

0 Likes