我正在尝试在我的应用中使用Firebase.
向Gradle添加三行后,我收到此错误:
错误:(27,13)无法解决:com.google.firebase:firebase-core:9.8.0
以下是我的代码的一些图像:
为什么我收到此错误?
我无法在android studio上设置firebase的更新版本.我已经在站点firebase上创建了项目的json文件,并将其复制到项目中并在gradle中处理行后:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.android.application'
android {
// ...
}
dependencies {
compile 'com.google.firebase:firebase-core:9.0.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
failed to resolve: compile 'com.google.firebase:firebase-core:9.0.0'
我该如何解决?
我注意到Firebase API已从v 9.0.0升级到v 9.0.1,因此决定更改它.
然而,它没有被注意到.
这是Gradle Logcat中的错误
Error:(25, 13) Failed to resolve: com.google.firebase:firebase-messaging:9.0.1
Error:(26, 13) Failed to resolve: com.google.firebase:firebase-core:9.0.1
Run Code Online (Sandbox Code Playgroud)
这是我的Gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.lifeline.applicationgreat"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-messaging:9.0.1'
compile 'com.google.firebase:firebase-core:9.0.1'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
// Top-level build …Run Code Online (Sandbox Code Playgroud)