![](/img/trans.png)
[英]Error:Execution failed for task ':app:processDebugGoogleServices'. Android
[英]Error: Execution failed for task ': app: processDebugGoogleServices
我在Android Studio中有一个错误。 新活动空白应用程序,我添加“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'
编译,错误是:
“错误:任务执行失败':app:processDebugGoogleServices'.Com.google.gson.stream.MalformedJsonException:第28行第20栏的预期名称”
我重新安装了Android Studio,SDK,并且总是一样,有什么想法吗?
您的应用似乎正在进行Google登录。
apply plugin: 'com.google.gms.google-services'
语句会尝试解析你的google-services.json
文件(通常位于app文件夹中)
打开该文件,在第28行查找任何格式错误的JSON。
(可能将其复制/粘贴到在线JSON验证器中 )。
有时编辑器用来修改'google-services.json'也会导致问题。 我使用OS X TextEdit进行编辑,问题发生了,但在我使用UltraEdit之后,问题就解决了。 我想也许是文件编码问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.