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))
}
}