programing

Android Studio - 프로그램 유형이 이미 있음: com.google.android.gms.internal.measurement.zzwp

oldcodes 2023. 6. 28. 21:59
반응형

Android Studio - 프로그램 유형이 이미 있음: com.google.android.gms.internal.measurement.zzwp

어제는 앱이 잘 작동했습니다.

오늘은 안드로이드 스튜디오를 다시 연 후에 앱이 더 이상 컴파일이 안 된 이유를 모르겠습니다.

표시된 오류는 다음과 같습니다.

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 Module:app입니다.

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'

는 『 』를 한 후 되었습니다.firebase dependencies예를 들어 최근의 것으로com.google.firebase:firebase-core:15.0.0com.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'
    }

build.gradle에서 합니다.classpath 'com.google.gms:google-services:3.1.1classpath 'com.google.gms:google-services:3.2.1

나도 이 오류가 있고 이 문제에 대한 나의 해결책이 있습니다.

Google Play 서비스 버전과 독립적으로 Firbase 버전 업데이트

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

https://firebase.google.com/support/release-notes/android#latest_sdk_versions 에서 최신 버전을 확인할 수 있습니다.

최상위 build.gradle 파일 업데이트 구글 서비스 3.1.1에서 3.2.1로

buildscript {
    dependencies {

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

    }
 }

나는 그냥 갈아입습니다.

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

로.

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

그건 효과가 있다.

파이어베이스는 그들이 개발자들에게 관심이 없는 것처럼 버전 번호를 업데이트하는 이유입니다.

첫 번째 일부터.프로젝트 수준 그라들의 클래스 경로 업데이트

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에 게시하여 사전 통지 없이 또는 적절한 문서 없이 이러한 변경을 수행하지 않도록 하십시오.

파이어베이스 종속성을 업데이트합니다.

프로젝트 수준 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's Maven repository
    }
}

앱 수준 build.gradle

사용하는 경우 아래의 종속성을 업데이트하십시오.파이어베이스에는 이제 모든 종속성에 대한 개별 버전이 있습니다.

최신 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

Google 플러그인을 잊지 마십시오.

또한 추가하는 것도 잊지 마십시오.apply plugin: 'com.google.gms.google-services'앱 수준 build.gradle의 맨 아래에 있습니다.

동기화 및 빌드...

"com.google.android.gms"가 포함된 종속성을 제거한 다음 프로젝트를 다시 빌드하십시오.거기서 두 번을 사용하는 의존성이 있기 때문에 당신은 노력해야 합니다.

예를들면com.android.support:design추가 트위스트

저는 오늘 같은 문제에 직면했습니다.구글은 2018년 5월 2일에 새로운 출시와 함께 제공됩니다.

링크로 이동하여 문서에 따라 버전 번호를 설정하십시오.

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

예를 들어

파이어베이스 코어 com.google.파이어베이스:파이어베이스 코어:15.0.2

이것은 지난 버전에 파이어베이스 분석을 추가한 후에 저와 함께 발생했습니다, 이렇게.

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

버전을 16.0.4로 변경하는 데 도움이 되었습니다.

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

나에게 이 문제는 안드로이드 빌드 도구 때문인 것처럼 보였습니다.

고치기 위해, 저는 이것들을 mu 프로젝트의 최상위 수준으로 다운그레이드해야 했습니다.build.gradle파일

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

이것이 최선의 해결책이 아니라는 것을 알고 있지만, 지금까지 저에게 효과가 있었던 유일한 방법입니다.

편집: 또는 추가android.enableD8=false프로젝트에gradle.properties파일

다음과 같은 종속성을 언급한 것이 문제를 해결했습니다.

implementation 'com.google.android.gms:play-services-analytics::16.0.7'
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"
       }
     }
 }

좋아요, 잠깐만요.모든 Firebase 라이브러리에 해당 버전이 필요하지 않음을 확인했습니다.버전이 잘못 정렬되었습니다.실제로 공식 페이지에서 일부는 15.0.2가 아닌 15.1.0에 있다고 보고합니다.

유용할 수 있는지 여기서 직접 확인해 보십시오.

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

이 오류와 비슷한 상황이 발생했습니다.

com.google.android.gms.internal 프로그램 유형이 이미 있습니다.*

저는 원시그널과 리액트 네이티브 맵을 동시에 사용하고 있었는데, 두 맵에서 gms를 제외하고 상위 레벨에 포함시켰습니다.

https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md#troubleshooting 의 문제 해결 섹션을 참조하십시오.

컴파일을 차단하는 다른 문제가 발생할 경우 Google 서비스 종속성을 3.2.0으로 업그레이드하십시오.저는 적어도 3.2.1과 3.3.0이 문제를 일으켰고 3.2.0이 작동했습니다.

언급URL : https://stackoverflow.com/questions/50146640/android-studio-program-type-already-present-com-google-android-gms-internal-me

반응형