我正在跟踪这文档以将FirebaseUI添加到我的项目中,但我有2个错误(未能找到com.google.android.gms.phenotype的提供者信息& Google服务丢失或没有正确的许可)。
当我在依赖项中写入该行时,会发生此错误:
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'我的梯度应用程序:
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 24
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//firebase
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation'com.google.firebase:firebase-database:16.0.1'
implementation'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0' // the problem is here ??
//noinspection GradleCompatible
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:appcompat-v7:24.2.0'
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
}
apply plugin: 'com.google.gms.google-services'我的分级计划:
buildscript {
repositories {
jcenter()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}我的逻辑猫:
e08-02 08:48:30.431 8422-8440/com.google.firebase.chat E/ActivityThread:找不到com.google.android.gms.phenotype的提供者信息 08-02 08:48:30.510 8422-8443/com.google.chat E/FirebaseInstanceId: Google服务丢失或未经正确许可。 08-02 08:48:30.550 8422-8443/com.google.chat E/FirebaseInstanceId: Google服务丢失或未经正确许可。 08-02 08:48:30.927 8422-8445/com.google.chat E/ActivityThread:未能找到com.google.android.gms.chimera的提供者信息 08-02 08:48:31.079 8422-8443/com.google.chat E/FirebaseInstanceId: Google服务丢失或未经正确许可。 08-02 08:48:41.128 8422-8443/com.google.chat E/FirebaseInstanceId: Google服务丢失或未经正确许可。
发布于 2018-08-02 11:48:42
要解决这个问题,请更改以下代码行:
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'至
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'和以下代码行:
classpath 'com.google.gms:google-services:4.0.1'至
classpath 'com.google.gms:google-services:4.0.2'而且似乎还需要添加以下代码行:
implementation 'com.google.android.gms:play-services-auth:15.0.1'发布于 2018-08-02 12:09:04
此问题似乎与设备有关,请确保在测试设备上安装了Google服务。
发布于 2018-08-02 12:10:38
您需要将所有google服务库的版本保持相同。每个Firebase UI版本对应于特定的Google服务版本。
根据文档(https://github.com/firebase/FirebaseUI-Android)
在4.1.0版中,FirebaseUI有以下依赖版本:
库版本firebase-auth 16.0.1
比赛-服务- 15.0.1
数据库16.0.1 ..。
更新的:对于"Google服务丢失或未经正确许可“的错误,您可以在这个链接中尝试这个建议
“下载google服务sdk并在清单中添加ACCESS_FINE_LOCATION权限(如果没有添加)”
https://stackoverflow.com/questions/51652700
复制相似问题