Плагин с идентификатором com.google.firebase.appdistribution не найден

Я пытаюсь добавить распространение приложений Firebase через Gradle в свое приложение для Android и вижу эту ошибку: «Плагин с идентификатором com.google.firebase.appdistribution не найден».

Приложение может нормально работать, если я закомментирую «применить плагин:» com.google.firebase.appdistribution ».

Я создал новый образец приложения и просто пытаюсь собрать его с помощью плагина com.google.firebase.appdistribution. Я выполнил эти шаги до T (https://firebase.google.com/docs/app-distribution/android/distribute-gradle) и все еще вижу эту ошибку

Вот мой модуль приложения build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

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


android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    google()
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'

    implementation 'com.google.firebase:firebase-appdistribution-gradle:1.1.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.1'

    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-firestore:21.2.1'
}

apply plugin: 'com.google.gms.google-services'  // Google Play services Gradle plugin

Я ожидаю, что он хотя бы построится, но, похоже, он даже не может найти плагин. Неправильно ли загрузили что ли?


person Jethro82    schedule 04.11.2019    source источник


Ответы (1)


Это не зависимость от Java; он читает classpath, а не implementation.

Вам нужно будет добавить этот плагин Gradle в build.gradle корневого проекта:

buildscript {
    repositories {
        google()
    }
    dependencies {
        classpath "com.google.firebase:firebase-appdistribution-gradle:1.1.0"
    }
}
person Martin Zeitler    schedule 04.11.2019