Ошибка: Тип программы уже присутствует: com.google.android.gms.common.internal.zzb

#android #gradle #android-gradle-plugin

#Android #gradle #android-gradle-plugin

Вопрос:

У меня проблема с выполнением команды «Сгенерировать подписанный пакет» с информацией «Сгенерировать подписанный пакет: ошибки при создании файла пакета. Вы можете найти ошибки в представлении «Сообщения».»

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "net.persmaeuridice.rppkurikulum2013revisi"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 3
        versionName "3.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
apply plugin: 'com.google.gms.google-services'

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:gridlayout-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.android.gms:play-services-ads:17.1.3'
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    implementation 'com.firebaseui:firebase-ui:0.6.2'
    implementation 'com.github.hani-momanii:SuperNova-Emoji:1.0'
    implementation 'com.github.lguipeng:BubbleView:1.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
  

Я использовал много способов, чтобы найти решение на пределе своих возможностей, для этого мне нужна ваша помощь в решении моей проблемы

где я допустил ошибку?

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        maven {url "https://jitpack.io",}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
  

Ответ №1:

существует конфликт между этими двумя библиотеками

 implementation 'com.google.android.gms:play-services-ads:17.1.3'
implementation 'com.firebaseui:firebase-ui:0.6.2'
  

попробуйте удалить, если какая-либо из них не нужна