添加Firestore依赖项后,它停止工作。我需要它们(firestore和auth),尝试使用更多版本,并且使用不同的版本,但现在它们是最后一个。
这是我得到的身份验证错误:
W / BiChannelGoogleApi:[FirebaseAuth:] getGoogleApiForMethod()返回了Gms:com.google.firebase.auth.api.internal.zzal@ad3ce63 W / DynamiteModule:找不到com.google.firebase.auth的本地模块描述符类。 W / GooglePlayServicesUtil:Google Play服务已过期。需要12451000但找到11743470
以及Firestore错误:
W / Firestore:(18.1.0)[OnlineStateTracker]:无法访问Cloud Firestore后端。后端在10秒钟内没有响应这通常表明您的设备目前没有正常的Internet连接。客户端将以脱机模式运行,直到能够成功连接到后端为止。
我有这些依赖关系,也许我认为它们不能正常工作?
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.philliphsu:bottomsheetpickers:2.4.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-auth:16.2.0'
implementation 'com.google.firebase:firebase-firestore:18.1.0'
}
apply plugin: 'com.google.gms.google-services'
编辑:
解决方案:问题是我更新了Google Play服务,现在我的应用正在运行。
答案 0 :(得分:0)
您是否已将权限<uses-permission android:name="android.permission.INTERNET" />
添加到清单中?
答案 1 :(得分:0)
可能是您忘记了gms服务,但我不确定。试试这个,给我反馈。谢谢,..
// Firestore
implementation 'com.google.firebase:firebase-firestore:18.1.0'
implementation 'com.google.firebase:firebase-storage:16.1.0'
// Other Firebase
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'