简体   繁体   English

Android Firebase 应用程序分发 - 服务凭证文件不存在。 请检查服务凭据路径,然后重试

[英]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.我正在尝试从 Crashlytics Beta 迁移到 Firebase App Distribution。 CircleCi in the Middle. CircleCi 在中间。

The build failes in CircleCi with the following error: CircleCi 中的构建失败并出现以下错误:

  • What went wrong: Execution failed for task ':FiverrApp:appDistributionUploadRelease'.出了什么问题:任务“: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:这是我在 build.gradle 中配置 serviceCredentialsFile 变量的方式:

        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.文件 api-project-xxx-yyy.json 与 build.gradle 文件位于同一文件夹中。 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.仍然没有运气......如果有人可以帮助我,将不胜感激。

Try to use $rootDir to get a path.尝试使用$rootDir获取路径。 For example if you pass you credentials file api-project-xxx-yyy.json to root directory than you can take it something like this:例如,如果您将凭据文件api-project-xxx-yyy.json到根目录,则可以这样:

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

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.您的api-project-xxx-yyy.json很可能不在您的根目录中,但您想使用项目的目录。

I use VS-Code.我使用 VS 代码。 I right-clicked on the json file in Explorer, copied the path (the full path) and set it in build.gradle我在资源管理器中右键单击json文件,复制路径(完整路径)并设置在build.gradle

serviceCredentialsFile= "path" serviceCredentialsFile="路径"

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: file.json 存在于:

  • Main Folder主文件夹
    • .idea 。主意
    • app应用程序
    • build建造
    • file.json文件.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用服务帐户凭据模式的 Firebase 分发 android 应用程序拒绝权限 - Permission denied with Firebase distribution android app using service account credentials mode 将Google服务凭据添加到Android App中以连接Google Cloud - Add Google service credentials to Android App for connect Google Cloud 通过提供凭据使用Android应用程序登录到Web服务 - login using android app to a web service by supplying credentials 如何在Android应用程序中保护服务帐户凭据? - How to secure service account credentials in an Android application? 通过Android将网络凭据传递到Web服务 - Passing network credentials to web service via android Firebase Android 上的凭据无效 - Firebase invalid credentials on Android Firebase服务帐户凭据Json读取权限被拒绝 - Firebase Service Account Credentials Json Read permission denied 安装失败,请检查安装日志,然后在Android Studio中重试 - Installation failed please check the installation log and try again in Android Studio 在Android应用中存储凭据 - Storing credentials in the Android app Firebase 分发错误:上传分发失败。 处理您的二进制文件的时间比预期的要长,请重试 - Firebase distribution Error: failed to upload distribution. it took longer than expected to process your binary, please try again
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM