question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

google_app_id and google_api_key sometimes missing

See original GitHub issue

Describe the bug After updating to 4.3.10 our builds sometimes are missing some fields like google_app_id and google_api_key. There’s no indication of a build problem (I would expect a build fail) during the build process only when starting the app and noticing that firebase is crashing because the google_app_id is missing.

It only happens on some builds, on our CI, and those builds are from the command line. It happens both for debug and release builds.

To Reproduce Steps to reproduce the behavior:

  1. Build apk
  2. Analyze apk

Expected behavior google_app_id and google_api_key should be part of the resources

Desktop (please complete the following information):

  • Gradle version: 7.0.2
  • Android Studio version : Irrelevant, fails on gradle CLI build
  • Plugin name and version [e.g. OSS Licenses 16.0.0]: Google services plugin 4.3.10

Additional context

I noticed this message during the build when it happend:

> Task :app:mergeBonialReleaseResources
Execution optimizations have been disabled for task ':app:mergeBonialReleaseResources' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/bitrise/src/app/build/generated/res/google-services/bonial/release'. Reason: Task ':app:mergeBonialReleaseResources' uses this output of task ':app:processBonialReleaseGoogleServices' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :app:processBonialReleaseGoogleServices
Execution optimizations have been disabled for task ':app:processBonialReleaseGoogleServices' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/bitrise/src/app/build/generated/res/google-services/bonial/release'. Reason: Task ':app:mergeBonialReleaseResources' uses this output of task ':app:processBonialReleaseGoogleServices' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

4reactions
ILikeYourHatcommented, Feb 11, 2022

If you need a working workaround (Groovy):

afterEvaluate {
    mergeDebugResources.mustRunAfter(processDebugGoogleServices)
    mergeReleaseResources.mustRunAfter(processReleaseGoogleServices)
}

Maybe not very DRY, but does the job 😄

3reactions
choongyouqicommented, Mar 1, 2022

a kotlin dsl version that works with multiple buildTypes and productFlavors

afterEvaluate {
    val buildTypes = android.buildTypes.map { it.name.capitalize() }
    val productFlavors = android.productFlavors.map { it.name.capitalize() }
    productFlavors.forEach { productFlavor ->
        buildTypes.forEach { buildType ->
            val processGoogleServicesTask = tasks
                .findByName("process${productFlavor}${buildType}GoogleServices") ?: error("googleTask not found")
            val mergeResourcesTask = tasks
                .findByName("merge${productFlavor}${buildType}Resources") ?: error("mergeTask not found")
            mergeResourcesTask.mustRunAfter(processGoogleServicesTask)
        }
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Api Key Missing - android - Stack Overflow
Ok Guys, it looks like it does work, but it doesnt show my map, it's a grey field. I figured out i can...
Read more >
Missing google_app_id #458 - firebase/quickstart-android
Firebase works fine but I get this error for analytics "GoogleService failed to initialize, status: 10, Missing google app id value from from...
Read more >
Authenticate using API keys - Google Cloud
This page describes how to use API keys to authenticate to Google Cloud APIs and services that support API keys. Most Google Cloud...
Read more >
Firebase configuration - MSDN - Microsoft
"Missing google app id value from from string resources with name ... I appreciate your answers to my questions, as it sometimes seems ......
Read more >
Multi-Dimensional Identification of Vulnerable Access Control ...
Today, mobile applications (apps for short) are everywhere and they often need to ... missing validation or local validation. ... google api key....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found