简而言之,当我在APP-LEVEL build.gradle文件中实现最新版本的firebase-core(版本16.0.7)时,当我与Gradle文件同步时,它无法下载firebase的依赖项之一核心,称为firebase-measurement-connector-impl。它搜索版本17.0.5,但无法下载。
我查看了Google的Maven存储库(maven.google.com)和mvnrepository.com,该版本存在。但是,当我尝试自己手动(使用Chrome)下载.jar文件时,也会出错!它显示“错误-没有文件”。我在找东西还是在想东西(像往常一样)?
应用程序级build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
check.dependsOn 'assembleDebugAndroidTest'
android {
compileSdkVersion 28
flavorDimensions "minSdkVersion"
defaultConfig {
applicationId "me.testweb.firebaseoauthtest"
buildToolsVersion("28.0.3")
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
buildToolsVersion '28.0.3'
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-
annotations:28.0.0'
}
dependencies {
implementation project(':chooser')
implementation project(':lintchecks')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
// Firebase Authentication
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-auth:16.1.0'
// Google Sign In SDK (only required for Google Sign In)
implementation 'com.google.android.gms:play-services-auth:16.0.1'
// Firebase UI
// Used in FirebaseUIActivity.
implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
// Twitter Android SDK (only required for Twitter Login)
implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
implementation 'com.twitter.sdk.android:twitter:3.3.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21"
}
apply plugin: 'com.google.gms.google-services'
项目级build.gradle:
// 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.3.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
}
}
allprojects {
repositories {
//mavenLocal() must be listed at the top to facilitate testing
mavenLocal()
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
预期结果是,构建过程将成功下载所有内容(包括firebase-measurement-connector-impl),并且不会显示任何错误。
实际结果是,将无法下载firebase-measurement-connector-impl,但一切仍能成功构建(???)。
答案 0 :(得分:1)
从 实施'com.google.firebase:firebase-core:16.0.7' 至 实施'com.google.firebase:firebase-core:16.0.5'