【发布时间】:2019-01-21 16:53:56
【问题描述】:
我的项目昨天运行良好。我今天打开它并收到此错误:
Program type already present: com.google.android.gms.internal.auth.zzao
我尝试更新 firebase 库,然后出现这些错误并且单击安装不起作用:
Failed to resolve: com.google.firebase:firebase-core:17.3.0
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-maps:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-location:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-places:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-auth:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-basement:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-tasks:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Failed to resolve: com.google.firebase:firebase-common:17.3.0
Open File
Show in Project Structure dialog
Failed to resolve: com.google.firebase:firebase-iid:17.3.0
Open File
Show in Project Structure dialog
Failed to resolve: com.google.firebase:firebase-measurement-connector:17.3.0
Open File
Show in Project Structure dialog
Failed to resolve: com.google.android.gms:play-services-gcm:17.3.0
Install Repository and sync project
Open File
Show in Project Structure dialog
我尝试更新目标并将 sdk 编译到 28 并得到一个错误,因为所有支持库都低于目标 sdk,但没有将它们更新到最新的选项。我尝试将构建工具更新到 28.0.2,但这也没有帮助,而且奇怪的是它并没有提示我它落后了,我不得不手动查看最新安装的并放置它。不知道接下来要尝试什么。什么都没有改变,它只是停止工作。以下是我的 gradle 文件。谢谢。
应用分级
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.2'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "removed"
manifestPlaceholders = [
onesignal_app_id : 'removed',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
minSdkVersion 19
targetSdkVersion 27
versionCode 50
versionName "2.6"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:27.1.1'
implementation 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.mikepenz:fontawesome-typeface:4.6.0.3@aar'
implementation('com.mikepenz:materialdrawer:5.6.0@aar') {
transitive = true
}
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.eminayar.panterdialog:panter-dialog:0.0.2.1'
implementation 'com.mikhaellopez:circularprogressbar:1.1.1'
implementation files('libs/core-3.2.1.jar')
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.afollestad:material-cab:0.1.12'
implementation 'com.sandrios.android:sandriosCamera:1.0.8'
implementation 'com.github.paolorotolo:appintro:4.1.0'
implementation 'com.wdullaer:materialdatetimepicker:3.5.1'
implementation 'com.onesignal:OneSignal:3.8.4'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation ('com.facebook.android:facebook-android-sdk:4.33.0') {
exclude(group: "com.google.zxing", module:"core")
}
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.snapchat.kit.sdk:creative:1.0.2'
implementation 'com.snapchat.kit.sdk:core:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
项目分级
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://maven.google.com" }
maven { url "https://storage.googleapis.com/snap-kit-build/maven" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.firebase:firebase-plugins:1.0.4'
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url "https://maven.google.com" }
maven { url "https://storage.googleapis.com/snap-kit-build/maven" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
【问题讨论】:
标签: android firebase android-studio android-gradle-plugin android-studio-3.0