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

若如初见. 提交于 2021-01-02 05:57:04

问题


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.


回答1:


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



回答2:


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.




回答3:


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


来源:https://stackoverflow.com/questions/58743588/android-firebase-app-distribution-service-credentials-file-does-not-exist-ple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!