这是我的build.gradle(app)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
compile 'com.firebaseui:firebase-ui-database:1.2.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
}
这些是我在build.gradle(项目)中的依赖项:
{
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
}
任何人都可以帮助解决我在这里做错的事吗?
答案 0 :(得分:0)
检查谷歌服务版本,它与gradle版本不兼容。
{
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
}
尝试降级或升级谷歌服务版本。
答案 1 :(得分:0)
缺少一些gradle和日志信息我试一试,但我可能错了:
构建(项目级别)(3.2.1不存在,为3.1.2)
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.1.2'
}
构建(应用级别)
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.firebaseui:firebase-ui-auth:2.3.0'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.firebaseui:firebase-ui:1.2.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.firebaseui:firebase-ui-storage:1.2.0'
( appcompat降级,firebase升级,编译替换为实现),我有类似appcompat的问题,降级到27.0.2为我解决了
答案 2 :(得分:0)
你不能使用firebase-ui 1.2.0。
compile 'com.firebaseui:firebase-ui-database:3.3.1'
compile 'com.firebaseui:firebase-ui-storage:3.3.1'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
compile 'com.firebaseui:firebase-ui-auth:3.3.1'
然后使用相同版本的Google Play服务库和firebase库:
compile 'com.google.firebase:firebase-auth:15.0.0'
compile 'com.google.android.gms:play-services-auth:15.0.0'
compile 'com.google.firebase:firebase-database:15.0.0'