Gradle 同步失败:对于输入字符串:“+"; [英] Gradle sync failed: For input string: "+"

查看:23
本文介绍了Gradle 同步失败:对于输入字符串:“+";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 Firebase SDK 添加到我的 Android 项目中.

I want to add Firebase SDK to my Android project.

我添加了

buildscript {
  dependencies {
    // Add this line
    classpath 'com.google.gms:google-services:3.1.0'
  }
}

到项目级别的gradle文件.

to project level gradle file.

然后我加了

// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

Gradle 要求同步.我收到以下错误:

Gradle asks for sync. And I get the following error:

12:35   Gradle sync failed: For input string: "+"
            Consult IDE log for more details (Help | Show Log)

我该如何解决?怎么了?

How can I fix that? What is wrong?

推荐答案

从两个依赖项中删除 + 符号.+ 运算符不能作为它自己的

Remove + sign from both dependencies. The + operator is not allowed as its own

尝试使用特定版本:

com.google.android.gms:play-services-maps:11.0.1
com.google.android.gms:play-services-location:11.0.1

com.google.android.gms:play-services-maps:11.0.+
com.google.android.gms:play-services-location:11.0.+

哪个将获取最新版本的 11.0 版本

Which will fetch the most recent version of 11.0 release

这篇关于Gradle 同步失败:对于输入字符串:“+";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆