androidcirclecicircleci-2.0firebase-app-distribution

Android Firebase app distribution - Service credentials file does not exist. Please check the service credentials path and try again


I'm trying to migrate from Crashlytics Beta to Firebase App Distribution. CircleCi in the Middle.

The build failes in CircleCi with the following error:

  • What went wrong: Execution failed for task ':FiverrApp:appDistributionUploadRelease'. Service credentials file does not exist. Please check the service credentials path and try again

Here is how i'm configuring serviceCredentialsFile variable In my build.gradle:

        release {
        buildConfigField "boolean", "FORCE_LOGS", "true"

        firebaseAppDistribution {
            releaseNotes="Notes\n" + getCommitMessages()
            groups="android-testers"
            serviceCredentialsFile="/api-project-xxx-yyy.json"
        }
    }

the file api-project-xxx-yyy.json is in the same folder with build.gradle file. I've also tried:

serviceCredentialsFile="api-project-xxx-yyy.json"
serviceCredentialsFile='api-project-xxx-yyy.json'

And still no luck... Would appreciate if someone can help me.


Solution

  • Try to use $rootDir to get a path. For example if you pass you credentials file api-project-xxx-yyy.json to root directory than you can take it something like this:

        firebaseAppDistribution {
            ...
            serviceCredentialsFile="$rootDir/api-project-xxx-yyy.json"
        }