【问题标题】:cvc-complex-type.2.4.a: Invalid content found starting with element 'base-extension'. One of '{codename, tag}' is requiredcvc-complex-type.2.4.a:发现以元素“base-extension”开头的无效内容。 '{codename, tag}' 之一是必需的
【发布时间】:2022-06-14 22:39:47
【问题描述】:

如果我将 classpath 'com.google.gms:google-services:4.2.0' 更改为 classpath 'com.google.gms:google-services:4.3.10' 并进行 gradle sync 我会收到该错误。

我使用的gradle插件版本是3.3.3,gradle JDK版本是1.8,gradle版本是4.10.1。

我正在努力应用 crashlytics,但我不知道为什么。请帮忙

参照


ext {
    minSdkVersion = 23
    compileSdkVersion = 30
    targetSdkVersion = 30

    buildToolsVersion = '30.0.2'
    supportLibraryVersion = '28.0.0'

    playSdkVersion = '8.4.0'
    firebaseVersion = '17.3.4'
    coroutineVersion = '1.0.1'

    imageLoaderSdkVersion = '1.9.3'

    appCompatVersion = '1.0.0'
    recyclerViewVersion = "1.0.0"
    mockitoVersion = "2.28.2"

    lifecycleVersion = "2.2.0"
}

我也收到以下错误。

com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create task ':app:processDebugGoogleServices'.
Cannot create a proxy class for abstract class 'GoogleServicesTask'.
> Could not create task ':app:processDebugGoogleServices'.
  Cannot create a proxy class for abstract class 'GoogleServicesTask'.
java.lang.reflect.UndeclaredThrowableException (no error message)
> java.lang.reflect.InvocationTargetException (no error message)

【问题讨论】:

    标签: android firebase crashlytics


    【解决方案1】:

    我升级gradle版本如下,解决了。

    classpath 'com.android.tools.build:gradle:4.1.3'

    【讨论】:

      【解决方案2】:

      我也遇到过类似的问题。 cvc-complex-type.2.4.a:发现以元素“base-extension”开头的无效内容。需要“{layoutlib}”之一。

      转到文件>>设置>>构建、执行、部署>构建工具 我启用“在构建脚本更改后重新加载项目”>任何更改。

      在此之后出现新错误“添加 Google maven 存储库” 我将 Google maven 存储库添加到 build.gradle 并且项目正常运行,没有任何错误。

      【讨论】:

        猜你喜欢
        • 2022-06-25
        • 2022-06-14
        • 2018-03-04
        • 1970-01-01
        • 1970-01-01
        • 2020-10-31
        • 2011-07-07
        • 2019-01-26
        • 2018-12-23
        相关资源
        最近更新 更多