Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Execution failed for task ': app: processDebugGoogleServices

I have a bug in Android Studio. New activity blank application, I add "build.gradle (project)"

 dependencies {
     classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
     classpath 'com.google.gms: google-services: 2.0.0-alpha9'
 }

And in "build.gradle (app)"

dependencies {
     compile FileTree (dir: 'libs', include: ['* .jar'])
     compile 'com.android.support:appcompat-v7:23.0.1'
     compile 'com.android.support:design:23.0.1'

     // Dependency for Google Sign-In
     compile 'com.google.android.gms: play-auth-services: 8.4.0'
}

apply plugin: 'com.google.gms.google-services'

Compile, and the error is:

"Error: Execution failed for task ': app: processDebugGoogleServices'. Com.google.gson.stream.MalformedJsonException: Expected name at line 28, column 20 "

I reinstalled Android Studio, SDK, and always the same, any ideas?

like image 217
John Vargas Avatar asked Feb 07 '23 20:02

John Vargas


1 Answers

It looks like you are doing Google Sign-in in your app.
The apply plugin: 'com.google.gms.google-services' statement would try to parse your google-services.json file (normally located in the app folder)
Open that file and look for any malformed JSON at line 28.
(Possibly copy/paste it into an online JSON validator).

like image 118
Magnus Johansson Avatar answered Feb 10 '23 23:02

Magnus Johansson