Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value

FirebaseCrashlyticsCrashlytics Android

Firebase Problem Overview


After updating the classpath I can no longer build a release version of the app.

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask').
  - Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value.
    
    Reason: This property isn't marked as optional and no value has been configured.
    
    Possible solutions:
      1. Assign a value to 'googleServicesResourceRoot'.
      2. Mark property 'googleServicesResourceRoot' as optional.



    A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask').
  - Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value.

I tried to read the changelog but no guidelines or documentation about it.

Firebase Solutions


Solution 1 - Firebase

To fix it, the Google Services plugin should be applied before any Firebase plugin in /app/build.gradle.

This produces the error:

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.firebase-perf'

While this does not:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf

Note that com.google.gms.google-services is ABOVE com.google.firebase.crashlytics.

When you update to com.google.firebase:firebase-crashlytics-gradle:2.7.0 and sync the changes, you are given a message stating that is the fix as follows:

Configure project :app
Crashlytics could not find Google Services plugin task: processReleaseGoogleServices. Make sure com.google.gms.google-services is applied BEFORE com.google.firebase.crashlytics. If you are not using the Google Services plugin, you must explicitly declare `googleServicesResourceRoot` inputs for Crashlytics upload tasks.

Solution 2 - Firebase

Make sure

'com.google.gms.google-services'

is applied before:

'com.google.firebase.crashlytics'

Fixed the error for me.

Solution 3 - Firebase

I also didn't found anything, for now changing to firebase-crashlytics-gradle to 2.6.1 seems ok.

Solution 4 - Firebase

My project didn't use 'com.google.gms.google-services'. You need to add 'com.google.gms.google-services' to the app level Gradle file in the plugins and, its corresponding classpath dependency classpath 'com.google.gms:google-services:latest-version' in the project level Gradle file.

Also make sure com.google.gms.google-services comes before com.google.firebase.crashlytics as stated by other answers.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBitwise DEVSView Question on Stackoverflow
Solution 1 - FirebaseRRiVENView Answer on Stackoverflow
Solution 2 - FirebasesebastianView Answer on Stackoverflow
Solution 3 - FirebaseDamianciooView Answer on Stackoverflow
Solution 4 - FirebaseRawlin CrastoView Answer on Stackoverflow