어제 내 앱이 잘 작동했습니다.
오늘은 Android Studio를 다시 연 후 앱이 더 이상 컴파일되지 않는 이유를 모르겠습니다.
표시된 오류는
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'
답변
firebase dependencies예 com.google.firebase:firebase-core:15.0.0를 들어 여기에서 최신 목록 가져 오기 와 같이을 최신 버전으로 업데이트 한 후이 문제가 해결 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에classpath 'com.google.gms:google-services:3.2.1
답변
이 오류도 있고이 문제에 대한 해결책이 있습니다.
1) Google Play 서비스 버전과 독립적으로 Firbase 버전 업데이트
implementation "com.google.firebase:firebase-messaging:15.0.2"
https://firebase.google.com/support/release-notes/android#latest_sdk_versions에서 최신 버전을 확인할 수 있습니다.
2) 최상위 build.gradle 파일에서 google-services를 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'
효과가있다.
답변
Firebase는 개발자를 신경 쓰지 않는 것처럼 버전 번호를 업데이트하는 이유입니다.
먼저 첫 번째 것들. 프로젝트 수준 Gradle에서 클래스 경로 업데이트
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에 게시하여 사전 안내없이 또는 적절한 문서없이 이러한 종류의 변경을 수행하지 않도록하십시오.
답변
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's Maven repository
}
}
2. 앱 수준 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
3. 구글 플러그인을 잊지 마세요
또한 apply plugin: 'com.google.gms.google-services'앱 수준 build.gradle 하단에 추가하는 것을 잊지 마십시오.
동기화 및 빌드 …
답변
“com.google.android.gms”가 포함 된 종속성을 제거한 다음 프로젝트를 다시 빌드하십시오. n try coz를 눌러야합니다. 거기에 두 번 사용하는 종속성이 있습니다.
예를 들어 com.android.support:designtwise 추가
답변
나는 오늘도 같은 문제에 직면했다. Google은 2018 년 5 월 2 일에 새 릴리스와 함께 제공됩니다.
링크로 이동하여 문서에 따라 버전 번호를 설정하십시오.
https://firebase.google.com/support/release-notes/android#20180502
예를 들어
Firebase Core com.google.firebase : firebase-core : 15.0.2
