Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ArcherEmiya05 opened this issue Jun 7, 2021 · 31 comments

Comments

@ArcherEmiya05
Copy link

After updating to classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.0'

A problem was found with the configuration of task ':app:uploadCrashlyticsMappingFileRelease' (type 'UploadMappingFileTask').
  - Type 'UploadMappingFileTask' property 'googleServicesResourceRoot' doesn't have a configured value.
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.
    
    Please refer to https://docs.gradle.org/7.0/userguide/validation_problems.html#value_not_set for more details about this problem.

I tried to read the documentation and changelog, however none of them help on how to fix the problem.

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@ArcherEmiya05
Copy link
Author

Any support?

@aokudan
Copy link

aokudan commented Jun 7, 2021

Help please

@ArcherEmiya05
Copy link
Author

ArcherEmiya05 commented Jun 7, 2021

We cannot compile/build a release aab with this update version due to this error.

@LouisCAD
Copy link

LouisCAD commented Jun 8, 2021

Hello, I'm affected as well since upgrading the Firebase Crashlytics Gradle plugin from 2.6.1 to 2.7.0.

Looks like that 2.7.0 version didn't undergo end-to-end testing… I have no choice but to revert the upgrade.

@peterhav
Copy link

peterhav commented Jun 8, 2021

Same issue here as well after upgrade to 2.7.0

@ouchadam
Copy link

ouchadam commented Jun 8, 2021

same issue, using gradle 7.0.2

@tasomaniac
Copy link

The tests probably did not find this issue since the firebase repo is not on Gradle 7 yet. It's actually on Gradle 5.x

@LouisCAD
Copy link

LouisCAD commented Jun 8, 2021

Gradle 5 is like 2 years old now? Maybe it's time to move to Gradle 6. Testing on latest Gradle release would be nice too.

@aguatno
Copy link

aguatno commented Jun 8, 2021

Hi @ArcherEmiya05 thanks reporting, we're currently looking into this. Quick question, may we know what Gradle version you are using when the error occurs? Also I tried the quickstart app with 7.0.1 Gradle Version and crashlytics-gradle:2.7.0 but I was not able to reproduce the issue. It would be great if you can provide a sample project where the issue is reproducible. Thanks

@LouisCAD
Copy link

LouisCAD commented Jun 8, 2021

Using Gradle 7.0.2 in my case.

@ArcherEmiya05
Copy link
Author

Hi @ArcherEmiya05 thanks reporting, we're currently looking into this. Quick question, may we know what Gradle version you are using when the error occurs? Also I tried the quickstart app with 7.0.1 Gradle Version and crashlytics-gradle:2.7.0 but I was not able to reproduce the issue. It would be great if you can provide a sample project where the issue is reproducible. Thanks

Gradle Plugin
7.1.0-alpha01

Gradle version
7.0

@frett
Copy link

frett commented Jun 9, 2021

It would be great if you can provide a sample project where the issue is reproducible. Thanks

This public PR: CruGlobal/godtools-android#1733 is having the same issue with the update (the currently failing GitHub Action check)

@mitaichik
Copy link

It happens on gradle 6.7.1 too

@pvtai
Copy link

pvtai commented Jun 11, 2021

Same to me

@vudzkostek
Copy link

vudzkostek commented Jun 11, 2021

It happens on Gradle 6.9 also, with android gradle plugin 4.2.1

@ubuntudroid
Copy link

ubuntudroid commented Jun 15, 2021

I'm on firebase-crashlytics-gradle 2.6.1 (not 2.7.0!) and am also affected. Seems the culprit is in firebase-crashlytics packaged in the 28.1.0 BOM rather than in firebase-crashlytics-gradle? 🤔 Didn't happen with the 28.0.1 BOM, but started to happen consistently right after updating the BOM.

My bad, I was actually on 2.7.0. So yes, that seems to be the culprit.

@aguatno
Copy link

aguatno commented Jun 15, 2021

Per checking it seems to be a compatibility issue with the Android Gradle plugin, though not 100% guaranteed since I can't reproduce locally. Let me assign for now. @mrichards could you have a look at this? (looks like a similar issue reported via support portal b/186748865).

@dmessano
Copy link

dmessano commented Jun 16, 2021

Found a fix for me.
AS 4.2.1Buld May 10,2021
Gradle Plugin 4.2.1
Gradle Version 7.1
com.google.firebase:firebase-crashlytics-gradle:2.7.0

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, note com.google.gms.google-services is now ABOVE com.google.firebase.crashlytics

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'

When you update to com.google.firebase:firebase-crashlytics-gradle:2.7.0 and sync the changes with them in the wrong order you are given an message stating that is the fix.

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.```

@vudzkostek
Copy link

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.```

This does not sound like a fix, it's just causing a crash a bit earlier, before crashlytics plugin configuration will try to get missing property.

@dmessano
Copy link

dmessano commented Jun 16, 2021

Sorry my comment might not have been clear, if you put com.google.firebase.crashlytics before com.google.gms.google-services you get that warning. (then if you try to build your project you get the error) If you put it how it tells you, then you don't get the warning or the build error.

i have edited my reply to make it clear, in the wrong order you get the warning

@frett
Copy link

frett commented Jun 16, 2021

I can verify that reordering the order that the google plugins are applied solved the issue for me.

@LouisCAD
Copy link

There's a plugins.withId API in Gradle on Project to avoid this kind of issues that the CrashLytics plugin can take advantage of.

@mrichards
Copy link
Contributor

mrichards commented Jun 16, 2021

Yes, @dmessano has it correct. As of 2.7.0, the order in which the plugins are applied is now relevant; this (ironically) is a side-effect of a change that will make it easier for customers to avoid using the GMS plugin if they choose. It also fixed a configuration cache issue in Gradle 7.

Are some builds not displaying the logged error with the directions on how to fix? ("Make sure com.google.gms.google-services is applied BEFORE com.google.firebase.crashlytics.") We were hoping this message would be sufficient to prevent support requests, but if it is not printing for folks, please let me know as I'd like to understand how to ensure it gets produced for your specific configuration.

@LouisCAD
Copy link

It's not showing up for me at least.

Did you test the error cases on your end to ensure the proper message is shown instead of another puzzling failure occuring before?

@dmessano
Copy link

The warning only shows up when you change and re-sync your gradle, it is also very easy to miss as it isn't red text and if you don't have the build window open it doesn't auto open. I didn't notice it until I went looking for a warning or error to see why my build was failing.

I can reproduce the warning without fail each time I put them in the wrong order and re-sync.
warning

@peterhav
Copy link

I've changed the build file and put this in place:

plugins {
id 'com.google.gms.google-services'
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.firebase.crashlytics'
....

Now LINT complains with the following warning: "Please apply google-services plugin at the bottom of the build file."

What to do?

@ubuntudroid
Copy link

@peterhav Try putting the crashlytics plugin at the very bottom of the plugin list and the google-services plugin right above that.

@peterhav
Copy link

Thanks, that worked. I now have:

plugins {
    ....
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}

@mrichards
Copy link
Contributor

The message is logged as a warning, not an error, because in some cases the build should be able to continue successfully. We'll consider changing the logic a bit to ensure it is logged as an error if the end result will be a failed build.

I'm going to close this issue as the root cause has been identified and the original issue is resolved. Please re-open if you believe this is in error.

@LouisCAD
Copy link

In which version has the issue been resolved?

@firebase firebase locked and limited conversation to collaborators Jul 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests