我在 Android Studio 中有一个错误。 新建activity空白应用,我添加“build.gradle(project)”
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
classpath 'com.google.gms: google-services: 2.0.0-alpha9'
}
在“build.gradle (app)”中
dependencies {
compile FileTree (dir: 'libs', include: ['* .jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
// Dependency for Google Sign-In
compile 'com.google.android.gms: play-auth-services: 8.4.0'
}
apply plugin: 'com.google.gms.google-services'
编译,错误为:
"Error: Execution failed for task ': app: processDebugGoogleServices'. Com.google.gson.stream.MalformedJsonException: Expected name at line 28, column 20 "
我重新安装了 Android Studio、SDK,还是一样,有什么想法吗?
最佳答案
您似乎正在您的应用中进行 Google 登录。
apply plugin: 'com.google.gms.google-services'
语句会尝试解析您的 google-services.json
文件(通常位于 app 文件夹中)< br/>
打开该文件并在第 28 行查找任何格式错误的 JSON。
(可能将其复制/粘贴到 online JSON validator 中)。
关于android - 错误 : Execution failed for task ': app: processDebugGoogleServices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35184524/