You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已存在google-services.json仍提示缺失的Android项目问题求助

Fixing the "google-services.json is missing" Error with nullnull Paths

Hey there, let's work through this frustrating issue! Those weird nullnull entries in the plugin's search path are the key here—something's broken with your build variant/flavor configuration, causing the plugin to generate invalid paths instead of looking in the right places.

Here are the steps to fix this:

  • Check your build variant configurations
    Open your app-level build.gradle file and look at the productFlavors and buildTypes blocks. Make sure none of your flavor or build type names are empty strings, misspelled, or using invalid characters. For example, avoid accidental empty flavor definitions like this:

    productFlavors {
        // This empty flavor name will cause nullnull paths!
        "" {
            applicationIdSuffix ".test"
        }
    }
    

    Double-check that all variants have valid, non-empty names.

  • Verify gradle properties for empty variables
    Check your gradle.properties or local.properties files to see if you've defined any variables used in variant naming that have empty values. For example, a line like APP_FLAVOR= would cause the plugin to generate a null value when building the path.

  • Manually specify the google-services.json path
    If the variant fix doesn't work, force the plugin to use the correct file by adding a googleServices block in your app-level build.gradle. You can set a global path or variant-specific paths:

    // Global path (uses the file in app/ directory)
    googleServices {
        path 'google-services.json'
    }
    
    // Or variant-specific paths
    productFlavors {
        debug {
            googleServices {
                path 'src/debug/google-services.json'
            }
        }
        release {
            googleServices {
                path 'src/release/google-services.json'
            }
        }
    }
    
  • Check for invalid folders in your project
    Head to the app/src directory and make sure there isn't an accidentally created folder named nullnull. If you find one, delete it immediately—it's likely confusing the plugin.

  • Re-download a fresh google-services.json
    Sometimes the existing file can get corrupted (even if it worked before). Go to your Firebase project console, re-download the correct google-services.json for your app, replace the old file, then run a Clean Project followed by Rebuild Project.

After trying these steps, the plugin should stop generating those invalid nullnull paths and find your existing file correctly.

内容的提问来源于stack exchange,提问作者ghita

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 14:22:55