【发布时间】:2017-02-14 03:00:49
【问题描述】:
我正在尝试开始友好聊天 Firebase 教程。但是 gradle 构建会引发错误,因为我不知道从哪里开始,所以我无法提供更多信息。然而,一张图片胜过千言万语,我相信它包含了所有相关的内容。
- 从 git google.json 下载的文件复制过来
- 添加和应用依赖项
- 构建工具和 IDE 已更新
我注意到只有一个项目 build.gradle 我找不到模块 build.gradle。我不知道这是否与这个问题有关。
最初抛出关于未注册 VCS 根的错误,我点击添加根,但它没有帮助。
build.gradle 两个文件都是蓝色的,当我单击其中一个时,它会打开名为 android-start 的选项卡(也是蓝色的),但路径是 C:\Users\User1\friendlychat\android-start\build.gradle,文件内容是:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.google.gms.google-services'
编辑:LogCat 说 configure Android SDK
如果我点击配置并设置我得到的 SDK 版本和构建工具版本:
Error:(31, 0) Could not find method android() for arguments [build_coejwo2h3fxgj0snev4rovui4$_run_closure4@512b9d86] on root project 'android-start' of type org.gradle.api.Project.
<a href="openFile:C:\Users\User1\friendlychat\android-start\build.gradle">Open File</a>
【问题讨论】:
-
"找不到模块 build.gradle"... 您的图片清楚地显示了
app/build.gradle和/build.gradle或您的项目。请在此处将它们显示为带有edit 的文本 -
谢谢,已编辑。它在哪里说它找不到 build.gradle/
-
另外一个,好吗?您也可以单击“显示登录资源管理器”并查看其中的内容吗?
-
只有一个 gradle 文件它打开了同样的东西,在 logcat 中它说配置 SDK
-
如果说要配置SDK,那就意味着你需要打开SDK Manager进行配置