简体   繁体   中英

Error: File google-services.json is missing. The Google Services Plugin cannot function without it.

i have already include google-services.json file in my app but it still give me error. Error:Execution failed for task ':app:processDebugGoogleServices'.

File google-services.json is missing. The Google Services Plugin cannot function without it. Searched Location: C:\\Users\\vikas\\AndroidStudioProjects\\FireBaseFunctionality\\app\\src\\debug\\google-services.json C:\\Users\\vikas\\AndroidStudioProjects\\FireBaseFunctionality\\app\\google-services.json

Had the same problem - builded before next step of tutorial. You have to generate and download the file from firebase website. See Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it" - late, but someone may need this nowdays.

go into SDK manager --> SDK tool---->install play service and USB tool and repository I have solved same problem with above method

or u can change the name of google service google-services.json instead of google-services(any number).json

just change in the build.gradle the line

compile fileTree (dir: 'libs', include: ['* .jar'])

to

implementation fileTree(dir: 'libs', include: ['*.jar'])

Go to your flutter sdk folder used to build the app. Delete all the contents in the folder .pub-cache Now pub-get and run.

Sometime we copy the downloaded file and put in app directory. But it changes the name. For example googleservices(1).json instead of googleservices.json. so make sure the name of file is correct.

What worked for me was:

And then follow the https://console.firebase.google.com steps to do in android studio:

Project-level build.gradle (/build.gradle):

buildscript {
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository

  }
  dependencies {
    ...
    // Add this line
    classpath 'com.google.gms:google-services:4.3.8'

  }
}

allprojects {
  ...
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository

    ...
  }
}

App-level build.gradle (//build.gradle):

apply plugin: 'com.android.application'

// Add this line
apply plugin: 'com.google.gms.google-services'


dependencies {
  // Import the Firebase BoM
  implementation platform('com.google.firebase:firebase-bom:28.3.0')


  // Add the dependency for the Firebase SDK for Google Analytics
  // When using the BoM, don't specify versions in Firebase dependencies
  implementation 'com.google.firebase:firebase-analytics'


  // Add the dependencies for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
}

Finally, press "Sync now" in the bar that appears in the IDE:

将您的 googleservices(number).json 更改为 googleservices.json no number 它对我有用 我刚刚遇到了同样的问题。

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