Blocking issue: Android credentials in multi-flavor config

I have an Android build configuration (bare workflow) with two productFlavors, one with the internal applicationId that I’m publishing to our internal Play account, and one with the production applicationId, that I’m publishing to the client’s Play account.

With a little workaround (changing the default applicationId manually), I have been able to upload credentials for both applicationIds to EAS, and I can see them in the web interface (this is a feature request in it’s own right, but at least it can be worked around).

However, eas will not select the credentials for the second applicationId, not even if I change the default applicationId in my build.gradle before kicking off the build.

As a workaround, I tried using the local credentials, but apparently, credentials.json doesn’t support storing more than one set of credentials at all.

All in all, short of overwriting credentials.json (‘CI style’) before kicking off the build, I have no way to run with EAS stored credentials, or locally configured ones, for the second productFlavor.

hi there! you could swap out the credentials provided in credentials.json depending on which flavor you’re building. the idea is not for credentials.json to have multiple credentials that are picked from at build time, but rather to specify exactly which credentials you wish to use for a particular build. we’ll discuss better affordances for product flavors, do let me know if you have any suggestions on how to handle it best.

Hi, that is what I suggested when I said ‘short of overwriting credentials’. But using credentials.json is a workaround to begin with, as I am able to store both sets of credentials for Android on EAS, but I’m unable to use them. I shouldn’t need a credentials.json, and it makes working in a team harder, because we can’t benefit from the credentials being uploaded to EAS.

the idea is not for credentials.json to have multiple credentials that are picked from at build time

Yet that is exactly how it works for iOS with multiple targets. Each one can be specified in credentials.json, and each one can have their own provisioningProfile etc.

do let me know if you have any suggestions on how to handle it best.

I would like Android productFlavors and iOS targets/schemes to be handled the same.

Every single project we do is set up exactly the same: on Android we have 2 productFlavors, each with their own keystores and applicationId, and their own api.json for uploading to either our own store, or the clients. on iOS, we have 2 schemes, each with their own applicationId and team, for uploading to our own Connect account, or the clients.

So far (because we only had bare workflow projects), we could sort of make this happen, but I’m now looking at the managed workflow too (because we don’t really have another reason left to go bare).

I’ll be happy to work with you to shape this functionality more.

[Kim Brandwijk]

1 Like

understood. thanks kim, we’ll discuss this further and get back to you