问题
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