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

4

12

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.

Medarda answered 7/11, 2019 at 7:9 Comment(0)
F
11

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"
    }
Frivolous answered 9/11, 2019 at 8:26 Comment(2)
windows --> i have given full path still im getting error > Service credentials file does not exist. Please check the service credentials path and try again got advice?Xenophanes
I have the same error with rootDir but when I log System.out.println("serviceCredentialsFile: $rootDir/api-project-xxx-yyy.json") I get the correct path...Tallent
J
3

Try using a relative path instead:

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

Most likely your api-project-xxx-yyy.json is not in your root directory but you want to use the project's directory.

Jone answered 7/11, 2019 at 9:17 Comment(1)
Still not working. I copied the file the parent directory, same errorMedarda
R
0

I use VS-Code. I right-clicked on the json file in Explorer, copied the path (the full path) and set it in build.gradle

serviceCredentialsFile= "path"

Recept answered 20/5, 2022 at 12:42 Comment(0)
M
-1

Ended up doing the following:

    buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }

    release {
        minifyEnabled false
        debuggable false
        signingConfig signingConfigs.release
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        firebaseAppDistribution {
            releaseNotes = "Notes\n" + getCommitMessages()
            groups = "android-testers"
            serviceCredentialsFile = "file.json"
        }
    }
}

file.json exist in:

  • Main Folder
    • .idea
    • app
    • build
    • file.json
Medarda answered 10/12, 2019 at 11:22 Comment(2)
I tried this solution but it just gave me the same error message "Service credentials file does not exist. Please check the service credentials path and try again" Any other idea what causes this? Seems like it is looking in completely wrong place. It looks in my /.gradle/daemon/6.0.1/ path.Migratory
@Migratory In my case it was related to granting permissions between firebase and the google cloud dashboard (Place where Firebase admin permission)Medarda

© 2022 - 2025 — McMap. All rights reserved.