Jorge
Jorge

Reputation: 315

Google Places API: PLACES_API_INVALID_APP

I have a project with three productFlavors and three buildTypes, and for every resultant app, the "package" name is different. My gradle file looks like this:

productFlavors {
    flavor1 {
        applicationId "com.example.flavor1"
    }

    flavor2 {
        applicationId "com.example.flavor1"
    }

    flavor3 {
        applicationId "com.example.flavor1"
    }
}

buildTypes {
    debug {
        applicationIdSuffix ".dev"
        versionNameSuffix "-dev"
    }

    integration {
        applicationIdSuffix ".int"
        versionNameSuffix "-int"
    }

    release {

    }
}

I have registered for an API key in the Google Developers Console with the package name com.example.flavor1.dev, and added the key to my manifest, but when I try to use the service, I receive an error with the message PLACES_API_INVALID_APP, so I assume something must be wrong with the package name, but I don't know what. Has someone ever had an issue like this?

Thanks!

Upvotes: 1

Views: 1267

Answers (2)

user3345708
user3345708

Reputation:

I solved the problem by creating a new API key with new credentials.

Upvotes: 0

pskkar
pskkar

Reputation: 442

Follow following steps: 1> Creating one new projects on Google Developer Console

2> API Manager > Credentials > New Credentials > API Key > Android Key > Press Create Button & Generate API KEY

Here, Creating key without applying package of application & SHA fingerprint is working in any application

MUST REMEMBER:

Enable Google Places API for Android

Upvotes: 2

Related Questions