android - 如何在 build.gradle 中找到 implementation() 方法?
问题描述
我想将firebase数据库添加到我的项目中,当android firebase中的firebase构建自动firebase依赖时,最后发生了这个错误:
错误:在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到参数 [com.google.firebase:firebase-database:16.0.1] 的方法 implementation()。构建.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "edmt.dev.androidsimsimi"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-database:16.0.1'
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'
})
implementation 'com.android.support:appcompat-v7:25.1.1'
testCompile 'junit:junit:4.12'
//Add Library
implementation 'com.android.support:design:25.1.1'
implementation 'com.github.lguipeng:BubbleView:1.0.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.android.volley:volley:1.1.1'
}
解决方案
推荐阅读
- c# - 如何初始化二维数组中的对象?
- twitter-bootstrap - 引导表单内的网格系统:内联选择和输入
- dart - 导航到新路线时释放小部件
- python - 标记变量 pd 数据框
- javascript - 每个人的下拉值都是唯一的,来自三个下拉框 jquery 的值不同
- amazon-web-services - 如何将 SpringBoot 微服务应用程序(RESTful)作为无服务器部署到 AWS Lambda?
- javascript - Google Apps Script: submit form + keep window content + make browser make an offer to save name/password
- machine-learning - 任意大动作/状态空间中的强化学习
- oracle - 使用 GET_FILE_NAME Oracle Forms 无法打开对话框
- javascript - Edittext 箭头 [Indesign 脚本]