mapbox / mapbox-android-demo

Google Play demo app for the Mapbox Maps SDK for Android
https://play.google.com/store/apps/details?id=com.mapbox.mapboxandroiddemo
BSD 2-Clause "Simplified" License
719 stars 493 forks source link

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

Closed tsuz closed 3 years ago

tsuz commented 3 years ago

What

Cannot build due to this error:

Execution failed for task ':MapboxAndroidDemo:processChinaDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it. 
   Searched Location: 
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/src/china/google-services.json
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/src/debug/google-services.json
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/src/chinaDebug/google-services.json
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/src/china/debug/google-services.json
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/src/debug/china/google-services.json
  /Users/takutosuzuki/Documents/projects/mapbox-android-demo/MapboxAndroidDemo/google-services.json

Versions

Android Studio 4.1

Branch master (commit)

Reproduce steps

  1. Create new folder and clone from this repository
  2. Follow the installation method in the README
  3. Build
  4. Build Fails

The build succeeds with one previous commit

nik736 commented 3 years ago

+1

bololo22 commented 3 years ago

+1

Chaoba commented 3 years ago

We can't upload google-services.json to this repo, because it's public. For those who want to run the demo project locally, please remove the following line in build.gralde file of MapboxAndroidDemo module.

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

tsuz commented 3 years ago

@Chaoba

Can you elaborate why this line is necessary? If it's not, we should remove this.

Chaoba commented 3 years ago

@tsuz Please visit https://firebase.google.com/docs/crashlytics/get-started?platform=android, we are using firebase to collect data for annalize, so we must apply google-service plugin. However, we already have the config for release, so this line is needless, I have fixed it here.

tsuz commented 3 years ago

@Chaoba

Thanks for the reply. Will that fix this issue of running the demo without the google services? If so, I can close my PR.

Chaoba commented 3 years ago

Yes, it will fix this issue.