Closed SkillsDelivery closed 5 months ago
I have the same issue
:app:uploadCrashlyticsMappingFileVariant1BuildType1 uses this output of task ':app:processVariant2BuildType1GoogleServices' without declaring an explicit or implicit dependency
(notice the different variants)
But that happened while running gradle tasks without variants.
So: gradlew app:bundleBuildType1
fails but gradlew app:bundleVariant1BuildType1
and gradlew app:bundleVariant2BuildType1
both work fine.
Hi @SkillsDelivery, thank you for reaching out. I was able to reproduce the issue. I'll notify our engineers and see what we can do here. Hang tight!
Same here as well.
We're encountering a recurring issue where the builds complete successfully, but towards the end, we encounter an error related to the Gradle task :app:uploadCrashlyticsMappingFileDevRelease. The specific problem identified by Gradle pertains to the location of a file at 'projectPath\app\build\gmpAppId.txt'
With 2.9.9 no prob.
Thanks for the reports and the output. The issue is the google-services plugin is outputting a file that Crashlytics consumes, but this file is getting clobbered when building multiple variants in a single build. I will fix this in google-services, then simply updating that plugin will resolve this issue.
For now, I have come up with a workaround you can do in your build.gradle.ktx
file:
import com.google.gms.googleservices.GoogleServicesTask
project.afterEvaluate {
tasks.withType<GoogleServicesTask> {
gmpAppId.set(project.buildDir.resolve("$name-gmpAppId.txt"))
}
}
dependencies {
compileOnly("com.google.gms:google-services:4.4.1")
}
I will update this issue when the fix is released.
Thanks for the reports and the output. The issue is the google-services plugin is outputting a file that Crashlytics consumes, but this file is getting clobbered when building multiple variants in a single build. I will fix this in google-services, then simply updating that plugin will resolve this issue.
For now, I have come up with a workaround you can do in your
build.gradle.ktx
file:import com.google.gms.googleservices.GoogleServicesTask project.afterEvaluate { tasks.withType<GoogleServicesTask> { gmpAppId.set(project.buildDir.resolve("$name-gmpAppId.txt")) } } dependencies { compileOnly("com.google.gms:google-services:4.4.1") }
I will update this issue when the fix is released.
That works.If you use build.gradle
,the workaround can be:
import com.google.gms.googleservices.GoogleServicesTask
project.afterEvaluate {
tasks.withType(GoogleServicesTask).configureEach {
gmpAppId.set(new File(project.buildDir, "${name}-gmpAppId.txt"))
}
}
dependencies {
compileOnly("com.google.gms:google-services:4.4.1")
}
Thanks for the workaround @mrober, buildDir
is deprecated, this small tweak worked:
project.afterEvaluate {
tasks.withType<GoogleServicesTask> {
gmpAppId.set(project.layout.buildDirectory.file("$name-gmpAppId.txt"))
}
}
If anybody wants to do this in Groovy
afterEvaluate {
tasks.withType(com.google.gms.googleservices.GoogleServicesTask).configureEach {
gmpAppId.set(layout.buildDirectory.file("$name-gmpAppId.txt"))
}
}
The last working version of com.google.gms.google-services for me is 4.3.15, everything later was somehow broken related to Firebase functionality. I don't understand why it is so badly maintained, almost dead project, together with ever more read oss-licenses-plugin :-(. Why it is not part of the Firebase libraries ecosystem?
@tprochazka well, when a company lays off thousands of engineers, things move slower.
We now live in a world where the stock market measures perceived suffering instead of perceived value.
We have to suffer to make the investors happy. I don't like it either.
I'm sorry. I try to leave this stuff out of GitHub but you were wondering why this is happening.
@tprochazka Ohh :-( the same in our company. I hope that it is better in Google.
Hey all, the version of google-services plugin that contains the fix for this issue (4.4.2) has been released: https://firebase.google.com/support/release-notes/android#google-services_plugin_v4-4-2
I've upgraded google-service to 4.4.2, and it still fails
Uploading mapping file '/Users/runner/work/1/s/mobile/android/app/build/protected/bundle/flavorRelease/ProGuardMappingFile.txt' to Crashlytics
Task :app:protectAabFlavorRelease FAILED
FAILURE: Build failed with an exception.
'void com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask.setMappingFileProvider(org.gradle.api.provider.Provider)'
@aantonic can you please run that task again with --stacktrace
?
It seems binary/source compatibility has been broken: (ai.digital.protectandroid is third-party component used for app protection)
Caused by: java.lang.NoSuchMethodError: 'void com.google.firebase.crashlytics.buildtools.gradle.tasks.UploadMappingFileTask.setMappingFileProvider(org.gradle.api.provider.Provider)' at ai.digital.protectandroid.protection.crashlytics.CrashlyticsMappingFileUploader.uploadMappingFile(CrashlyticsMappingFileUploader.kt:37) at ai.digital.protectandroid.protection.tasks.AppProtectionTask.applyProtection(AppProtectionTask.kt:90) at ai.digital.protectandroid.protection.tasks.AppProtectionTask.protectAab(AppProtectionTask.kt:75) at ai.digital.protectandroid.protection.tasks.AppProtectionTask.runProtection(AppProtectionTask.kt:26) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29) at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:248)
I am not sure about ai.digital.protectandroid.protection.crashlytics
sorry. It looks like they rely on implementation details, not the public api, of the Crashlytics Gradle plugin. And after v3, the implementation is entirely different.
The v3 of the Crashlytics plugin gets the merged mapping file from AGP via SingleArtifact.OBFUSCATION_MAPPING_FILE. There is likely no need for this tool to call the Crashlytics plugin directly like that to set the mapping file.
This is an issue you can file with them. I am closing this one since the issue is with them. But feel free to reference this issue, and I don't mind providing them with any information if they need it.
I upgraded crashlytics plugin to 3.0.1 and google-service plugin to 4.4.2 and now I could build with no problems. Everything seems to be fine now.
Thank you so much, guys! <3
Environment:
Problem description:
I just upgraded the version of "com.google.firebase.crashlytics" plugin from "2.9.9" to "3.0.1" and the build started to fail. Here is the build command which is failing:
The build succeeds if I build only one build type at a time by running either
or
Logs:
Relevant Code:
"com.google.gms.google-services" version: "4.4.1" "com.google.firebase:firebase-bom" version: "33.0.0"
Relevant parts of my app/build.gradle.kts file:
Relevant parts of my AndroidManifest.xml file:
Releavant parts of my proguard-rules.pro file: