Android Studio 3.4 Canary 3编译错误

时间:2018-11-11 15:56:25

标签: android-studio gradle groovy gradle-plugin

我无法执行干净的构建,而是使用最新的Android Studio预览版进行重建,否则会引发错误。

Unsupported type 
(com.google.gms.googleservices.GoogleServicesPlugin$Version) found for field 
'rangeStart' while constructing immutable class 
com.google.gms.googleservices.GoogleServicesPlugin$VersionRange.
Immutable classes only support properties with effectively immutable types including:
- Strings, primitive types, wrapper types, Class, BigInteger and BigDecimal, enums
- classes annotated with @KnownImmutable and known immutables (java.awt.Color, java.net.URI)
- Cloneable classes, collections, maps and arrays, and other classes with special handling
  (java.util.Date and various java.time.* classes and interfaces)
Other restrictions apply, please see the groovydoc for ImmutableOptions for further details

执行gradlew clean结果

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.

这是什么意思和解决方案?

2 个答案:

答案 0 :(得分:0)

目前,您应该在项目级别build.gradle中将google-services版本降级为 3.2.0

dependencies {
        classpath 'com.google.gms:google-services:3.2.0'
    }

一旦我对此有更多信息,将在这里更新。

答案 1 :(得分:0)

我终于通过更新到最新的Google服务here解决了该问题 然后将我的Firebase依赖项更新为最新版本。

        classpath 'com.google.gms:google-services:4.2.0'