Traccar Client Android with Android Studio - Error: File google-services.json is missing.

Afaq Ahmad Khan7 years ago

When I run this project . It is getting Build Faild

File google-services.json is missing. The Google Services Plugin cannot function without it. 
 Searched Location: 
D:\traccar\traccar-client-android\app\src\google\debug\google-services.json
D:\traccar\traccar-client-android\app\src\debug\google\google-services.json
D:\traccar\traccar-client-android\app\src\google\google-services.json
D:\traccar\traccar-client-android\app\src\debug\google-services.json
D:\traccar\traccar-client-android\app\src\googleDebug\google-services.json
D:\traccar\traccar-client-android\app\google-services.json
Afaq Ahmad Khan7 years ago

I got the solution.

goto https://console.firebase.google.com/
and add new project.

Anton Tananaev7 years ago

The right solution is to build regular flavor.

ginppian6 years ago

in build.gradle > dependencies > classpath 'com.google.gms:google-services:3.0.0'

example:

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'io.fabric.tools:gradle:1.26.1'
    }
Anton Tananaev6 years ago

@ginppian your comment doesn't seem to have anything to do with the topic. You should probably add some information to clarify what exactly you wanted to say.

ginppian6 years ago

Excuse me, in my case I got:

could not find com.google.gms:google-services:4.2.0.

And

The Google Services Plugin cannot function without it. Searched Location: ..\..google-services.json

I changed Build Variants from googleDebug to regularDebug and i changed too the 'classpath' from 'com.google.gms: google-services: 4.2.0' to 3.0.0. Work for me.