Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play console says leaked API Key even though using recommended way

I am using the following way to access my API key; which seems to be the recommended way; but when I upload my app to Play Console, I get a critical error when the pre-launch report is ran. Its says "Leaked GCP API Keys". I can confirm that the app eventually get approved as my previous version had the same error and same code. Below is my code, what is the better way to write this.

private fun setupPlacesSearch()
{
    if(!Places.isInitialized()){
        Places.initialize(applicationContext, getString(R.string.google_maps_key))
    }
}

enter image description here

like image 407
pnizzle Avatar asked Feb 02 '26 10:02

pnizzle


1 Answers

It seems it is just an alert, more than it is a warning. This resources says to ignore the warning if sufficient restrictions have been applied to the API Key so that it's use is restricted to a specific app(s).

like image 170
pnizzle Avatar answered Feb 04 '26 01:02

pnizzle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!