gpt4 book ai didi

java - 添加 Firebase 依赖项时出错

转载 作者:太空宇宙 更新时间:2023-11-04 10:57:08 26 4
gpt4 key购买 nike

当我将 firebase 库添加到 android studio 时,出现错误: enter image description here

我已成功下载 google-service.json 文件并正确放置,添加库时出现错误

// Top-level build file where you can add configuration options common to allsub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

这是我的应用程序级别依赖项

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.omarr.fireapp"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compie 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
testCompile 'junit:junit:4.12'

}
apply plugin: 'com.google.gms.google-services'

请帮帮我还请建议我应该熟悉的主题,以便将来能够自己解决这些错误。谢谢

最佳答案

compie 'com.google.firebase:firebase-database:11.6.0'
有一个拼写错误

它必须是编译而不是compie。正确的说法是:

    compile 'com.google.firebase:firebase-database:11.6.0'

关于java - 添加 Firebase 依赖项时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47252410/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com