【问题标题】:A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action执行 com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action 时发生故障
【发布时间】:2022-12-19 14:57:47
【问题描述】:

嗨,我在将 React native 版本 0.64 升级到 0.67,并将 gradle 版本 4.2.1 升级到 7.1.2 后运行 ./gradlew assembleRelease 时遇到问题,请帮我解决这个问题。

Task :library:verifyReleaseResources FAILED
  
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':library:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed
     ERROR:/Users/vv/.gradle/caches/transforms-3/8e1dbca81dfad29f4aee913d13f7c843/transformed/core-1.7.0/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

应用程序/build.gradlew

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
        ndkVersion = "21.4.7075529"
        kotlinVersion = "1.4.32"
        kotlin_version = '1.4.32'
        dokka_version = '0.10.1'
        androidxCoreVersion = '1.7.0'
    }
    repositories {
        google()
       mavenCentral()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:7.1.2')
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.10'
          classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
    }
}

【问题讨论】:

    标签: android react-native gradle


    【解决方案1】:

    我有一个非常相似的问题。将 Gradle 改回 4.2.1 将解决问题。我认为你所依赖的东西是用旧的 compileSdkVersion 构建的,它不适用于新的 Gradle 版本。

    【讨论】:

      【解决方案2】:

      我不知道这是否是一个合适的解决方案,但我遇到了同样的问题,我通过添加 'app:' 解决了这个问题,如下所示:

      gradlew 应用程序:assembleRelease

      希望这可以帮助 :)

      【讨论】:

        猜你喜欢
        • 2019-12-27
        • 2020-09-19
        • 1970-01-01
        • 2022-08-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-08-03
        • 2021-07-29
        相关资源
        最近更新 更多