Android Studio- Тип программы уже присутствует: com.google.android.gms.internal.measurement.zzwp - программирование
Подтвердить что ты не робот

Android Studio- Тип программы уже присутствует: com.google.android.gms.internal.measurement.zzwp

Вчера мое приложение работало нормально.

Сегодня я не знаю, почему приложение больше не компилировалось после того, как я снова открыл Android-студию.

Показанная ошибка:

Program type already present: com.google.android.gms.internal.measurement.zzwp
Message{kind=ERROR, text=Program type already present: com.google.android.gms.internal.measurement.zzwp, sources=[Unknown source file], tool name=Optional.of(D8)}

Я действительно не знаю, что происходит, я искал все и ничего не работал. Если бы кто-то мог мне помочь, я бы очень признателен. Я изменяю все зависимости и библиотеки, чтобы попытаться его решить, но ничего не получилось.

Вот проект build.gradle

buildscript {

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


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

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

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

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

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.doctordirectory"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    implementation fileTree(dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

    implementation ('com.facebook.android:audience-network-sdk:4.28.0',{
        exclude group: 'com.google.android.gms'
    })
    implementation 'com.facebook.android:facebook-login:4.32.0'
    implementation 'com.android.support:multidex:1.0.3'

    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'

    implementation 'com.android.support:support-v4:27.1.0'
    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'

    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.google.firebase:firebase-database:15.0.0'
    implementation 'com.google.firebase:firebase-crash:15.0.0'
    implementation 'com.google.firebase:firebase-auth:15.0.0'
    implementation 'com.google.firebase:firebase-storage:15.0.0'
    implementation 'com.firebaseui:firebase-ui-database:3.3.1'

    implementation 'com.google.android.gms:play-services-auth:15.0.0'
    implementation 'com.google.android.gms:play-services-plus:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'

    implementation 'com.android.support:cardview-v7:27.1.0'
    implementation 'com.android.support:recyclerview-v7:27.1.0'

    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

    implementation 'com.stepstone.apprating:app-rating:2.2.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.github.lguipeng:BubbleView:1.0.1'

    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'

    implementation 'com.miguelcatalan:materialsearchview:1.4.0'

    implementation 'com.github.MdFarhanRaja:SearchableSpinner:1.9'

    implementation 'com.github.sillebille:dynamic-calendar:1.0.1'

    implementation 'com.google.api-client:google-api-client:1.22.0'
    implementation 'com.google.api-client:google-api-client-android:1.22.0'
    implementation 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
}

apply plugin: 'com.google.gms.google-services'
4b9b3361

Ответ 1

Устранена эта проблема после обновления firebase dependencies до последней версии, например com.google.firebase:firebase-core:15.0.0 to com.google.firebase:firebase-core:15.0.2 Получить последний список здесь

Все другие изменения, внесенные в нижеследующий список

  dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:customtabs:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.0'
        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'

        implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'

        implementation 'com.facebook.android:audience-network-sdk:4.28.0'
        implementation 'com.facebook.android:facebook-login:4.32.0'
        implementation 'com.android.support:multidex:1.0.3'

        implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'

        implementation 'com.android.support:support-v4:27.1.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'

        implementation 'com.google.firebase:firebase-core:15.0.2'
        implementation 'com.google.firebase:firebase-database:15.0.0'
        implementation 'com.google.firebase:firebase-crash:15.0.2'
        implementation 'com.google.firebase:firebase-auth:15.0.0'
        implementation 'com.google.firebase:firebase-storage:15.0.2'
        implementation 'com.firebaseui:firebase-ui-database:3.3.1'

        implementation 'com.google.android.gms:play-services-auth:15.0.0'
        implementation 'com.google.android.gms:play-services-plus:15.0.0'
        implementation 'com.google.android.gms:play-services-location:15.0.0'

        implementation 'com.android.support:cardview-v7:27.1.1'
        implementation 'com.android.support:recyclerview-v7:27.1.1'

        implementation 'com.squareup.picasso:picasso:2.5.2'
        implementation 'com.squareup.retrofit2:retrofit:2.3.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

        implementation 'com.stepstone.apprating:app-rating:2.2.0'
        implementation 'com.android.support:design:27.1.1'
        implementation 'com.github.lguipeng:BubbleView:1.0.1'

        implementation 'uk.co.chrisjenx:calligraphy:2.3.0'

        implementation 'com.miguelcatalan:materialsearchview:1.4.0'

        implementation 'com.github.MdFarhanRaja:SearchableSpinner:1.9'

        implementation 'com.github.sillebille:dynamic-calendar:1.0.1'

        implementation 'com.google.api-client:google-api-client:1.22.0'
        implementation 'com.google.api-client:google-api-client-android:1.22.0'
        implementation 'com.google.apis:google-api-services-people:v1-rev4-1.22.0'
    }

2) На верхнем уровне build.gradle обновить файл из classpath 'com.google.gms:google-services:3.1.1 to classpath 'com.google.gms:google-services:3.2.1

Ответ 2

У меня тоже есть эта ошибка, и мое решение этой проблемы

1) Обновить версию Firbase для независимой от версии сервисов Google Play

implementation "com.google.firebase:firebase-messaging:15.0.2"

Вы можете проверить последнюю версию здесь https://firebase.google.com/support/release-notes/android#latest_sdk_versions

2) На верхнем уровне build.gradle обновляет файлы google-сервисов от 3.1.1 до 3. 2..1

buildscript {
    dependencies {

        classpath 'com.google.gms:google-services:3.2.1'

    }
 }

Ответ 3

Я просто меняю

implementation 'com.google.firebase:firebase-crash:15.0.0'

в

implementation 'com.google.firebase:firebase-crash:15.0.2'

оно работает.

Ответ 4

Firebase является причиной того, что они обновляют номера версий, так как они не заботятся о разработчиках.

Прежде всего. Обновить путь к классам на уровне уровня проекта

dependencies {

        classpath 'com.google.gms:google-services:3.2.1'

    }

Далее, какими бы инструментами вы ни пользовались, как аналитика, динамические ссылки и т.д. Используйте соответствующую зависимую версию.

https://firebase.google.com/support/release-notes/android

В моем случае я использовал тестирование A/B через удаленную конфигурацию, поэтому мне нужно обновить его из

implementation 'com.google.firebase:firebase-config:15.0.0'

в

implementation 'com.google.firebase:firebase-config:15.0.2'

Это должно работать без каких-либо сбоев. Кроме того, пожалуйста, разместите такие проблемы в Firebase, чтобы они не делали такого рода изменения без хедз-ап или без надлежащей документации.

Ответ 5

Удалите зависимость, содержащую "com.google.android.gms", а затем попробуйте перестроить проект... вам нужно выполнить попытку n try coz, есть некоторая зависимость, которая использует дважды там

Например, com.android.support:design добавил твиз

Ответ 7

Обновите свои зависимости от firebase.

1. Уровень проекта build.gradle

Обновите версию google.gms до последней версии. Отслеживайте последний выпуск. Во время ответа самое последнее - 4.1.0.

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.1.0' // google-services plugin
    }
}

allprojects {
    // ...
    repositories {
        // ...
        google() // Google Maven repository
    }
}

2. Уровень приложения build.gradle

Обновите зависимость ниже, если вы используете какой-либо. Обратите внимание, что firebase теперь имеет отдельные версии для каждой зависимости.

Используйте последние библиотеки Firebase. Во время ответа последние версии приведены ниже.

Firebase Core                com.google.firebase:firebase-core:16.0.3
Ads                          com.google.firebase:firebase-ads:15.0.1
Analytics                    com.google.firebase:firebase-analytics:16.0.3
App Indexing                 com.google.firebase:firebase-appindexing:16.0.1
Authentication               com.google.firebase:firebase-auth:16.0.3
Cloud Firestore              com.google.firebase:firebase-firestore:17.1.0
Cloud Functions              com.google.firebase:firebase-functions:16.1.0
Cloud Messaging              com.google.firebase:firebase-messaging:17.3.2
Cloud Storage   c            om.google.firebase:firebase-storage:16.0.2
Crash Reporting              com.google.firebase:firebase-crash:16.2.0
Crashlytics                  com.crashlytics.sdk.android:crashlytics:2.9.5
Dynamic Links                com.google.firebase:firebase-dynamic-links:16.1.1
Invites                      com.google.firebase:firebase-invites:16.0.3
In-App Messaging             com.google.firebase:firebase-inappmessaging:17.0.1
In-App Messaging Display     com.google.firebase:firebase-inappmessaging-display:17.0.1
ML Kit: Model Interpreter    com.google.firebase:firebase-ml-model-interpreter:16.2.0
ML Kit: Vision               com.google.firebase:firebase-ml-vision:17.0.0
ML Kit: Image Labeling       com.google.firebase:firebase-ml-vision-image-label-model:15.0.0
Performance Monitoring       com.google.firebase:firebase-perf:16.1.0
Realtime Database            com.google.firebase:firebase-database:16.0.2
Remote Config                com.google.firebase:firebase-config:16.0.0

3. Не забывайте плагин Google.

Кроме того, не забудьте добавить apply plugin: 'com.google.gms.google-services' внизу уровня приложения build.gradle.

Синхронизация и сборка...

Ответ 8

Сегодня я столкнулся с такой же проблемой. Google приходит с новой версией 02 мая 2018 года.

Перейдите по ссылке и установите версию no в соответствии с документом:

https://firebase.google.com/support/release-notes/android#20180502

например,

Firebase Core com.google.firebase: firebase-core: 15.0.2

Ответ 9

Это случилось со мной после добавления последней версии Firebase Analitycs, как это

implementation "com.google.firebase:firebase-core:16.0.5"

помогла смена версии на 16.0.4

implementation "com.google.firebase:firebase-core:16.0.4"

Ответ 10

Для меня проблема, казалось, была вызвана инструментами сборки Android

Чтобы исправить это, мне пришлось понизить их в mu-проектах верхнего уровня build.gradle file

-        classpath 'com.android.tools.build:gradle:3.1.0'
+        classpath 'com.android.tools.build:gradle:3.0.1'

Я знаю, что это не лучшее решение, но пока единственное, что сработало для меня.

EDIT: В качестве альтернативы добавьте файл android.enableD8=false в файл проекта gradle.properties

Ответ 11

Комментирование следующей зависимости устранило проблему для меня:

implementation 'com.google.android.gms:play-services-analytics::16.0.7'

Ответ 12

Если вы столкнулись с другими проблемами, которые блокируют компиляцию, попробуйте обновить зависимость служб Google до 3.2.0. Для меня, по крайней мере, 3.2.1 и 3.3.0 вызывали проблемы, а 3.2.0 - это тот, который работал.

Ответ 13

Хорошо, подождите секунду. Я проверял, что не все библиотеки Firebase нуждаются в этой версии. Теперь версии смещены. Фактически на официальной странице сообщается, что некоторые из них составляют 15.1.0 вместо 15.0.2;

Может быть, посмотрим прямо здесь, если это может быть полезно:

https://firebase.google.com/docs/android/setup

Ответ 14

У меня была похожая ситуация с этой ошибкой:

Тип программы уже представлен: com.google.android.gms.internal. *

Я использовал нативные карты OneSignal и React одновременно, я исключил gms из обеих и включил их на верхнем уровне.

См. Раздел устранения неполадок здесь: https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md#trou устранение неисправностей.

Ответ 15

allprojects {
    repositories {
    //start here
    configurations.all {
 resolutionStrategy.eachDependency { DependencyResolveDetails details ->
   def requested = details.requested
       if (requested.group == 'com.google.android.gms') {
          details.useVersion '12.0.1'
       }
       if (requested.group == 'com.google.firebase') {
          details.useVersion '12.0.1'
         }
       }
     }
    //end
     jcenter()
       maven {
         url "https://maven.google.com"
       }
     }
 }