3

我正在使用带有 Gradle 插件的 Firebase App Distribution。
当我尝试运行appDistributionUploadDebug命令时,我收到错误:

Getting appId from output of google services plugin

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:appDistributionUploadDebug'.
> Missing app id

build.gradle我在文件中包含了插件

   dependencies {
        classpath 'com.google.firebase:firebase-appdistribution-gradle:1.2.0'
    }

然后我添加了配置:

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.appdistribution'

android {
   //...
        debug {
            firebaseAppDistribution {
                serviceAccountCredentials = "/path/to/your-service-account-key.json"
                releaseNotesFile="/path/to/releasenotes.txt"
                testers="email@example.com"
            }
        }
}
4

2 回答 2

9

如果您没有在项目中使用 google services gradle 插件,则必须在配置中添加appId属性。

就像是:

            firebaseAppDistribution {
                // Firebase App Distribution setup
                appId = "...."  //<-- add your appID

                serviceAccountCredentials = "/path/to/your-service-account-key.json"
                releaseNotesFile="/path/to/releasenotes.txt"
                testers="email@example.com"
            }

您可以在文件中找到appIdgoogle-services.json

{
  ...
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "...",//<-- YOU NEED THIS APP_ID
        "android_client_info": {
          "package_name": "..."
        }
      },
     
  ...
}

或在项目设置页面上的 Firebase 控制台中 -> 常规选项卡。

于 2019-11-14T20:22:55.410 回答
0

使用 Gradle 将 Android 应用分发给测试人员

appDistributionVersion 2.0.0 上的输出错误:

找不到 APK。确保首先通过运行 ./gradlew assemble[Variant] 构建


为了可以找到 APK,请确保您首先通过运行构建./gradlew assemble[Variant]然后 ./gradlew appDistributionUpload[Variant].

$ ./gradlew assemble[Variant] appDistributionUpload[Variant]
于 2020-07-14T17:22:42.647 回答