在编译依赖项时,FCM数据库出现错误。

11 浏览
0 Comments

在编译依赖项时,FCM数据库出现错误。

我正在尝试使用FCM,但是在编译依赖文件时遇到了问题。它给出了一个错误,类似于在Gradle(Module:app)中

dependencies {
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:25.0.0'
}

错误

错误:
无法解析:com.google.firebase:firebase-core:10.0.1    
错误:(22, 13)无法解析:com.google.firebase:firebase-database:10.0.1    

请告诉我为什么它无法成功编译的原因。

0
0 Comments

问题原因:在编译依赖时出现FCM数据库错误。

解决方法:如果您使用的是Android Studio 2.0或更高版本,您可以按照以下简单步骤将firebase依赖项添加到Gradle中。按照这些步骤会自动将Gradle与最新的Firebase依赖项同步。然后,您应该尝试上述方法,让Android Studio完成Gradle同步工作。

0