无法解析 com.android.tools.build:aapt2:7.3.1-8691043

NoN*_*ame 7 gradle android-studio android-gradle-plugin

当我创建新项目时,项目成功运行,但之后当我退出 android studio 并重新打开项目时,会出现此错误

在此输入图像描述

Execution failed for task ':app:processDebugResources'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform material-1.7.0.aar (com.google.android.material:material:1.7.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Could not isolate parameters com.android.build.gradle.internal.dependency.AarResourcesCompilerTransform$Parameters_Decorated@8d32791 of artifact transform AarResourcesCompilerTransform
         > Could not isolate value com.android.build.gradle.internal.dependency.AarResourcesCompilerTransform$Parameters_Decorated@8d32791 of type AarResourcesCompilerTransform.Parameters
            > Could not resolve all files for configuration ':app:detachedConfiguration2'.
               > Could not find com.android.tools.build:aapt2:7.3.1-8691043.
                 Searched in the following locations:
                   - https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/7.3.1-8691043/aapt2-7.3.1-8691043.pom
                   - https://repo.maven.apache.org/maven2/com/android/tools/build/aapt2/7.3.1-8691043/aapt2-7.3.1-8691043.pom
                 Required by:
                     project :app

Run Code Online (Sandbox Code Playgroud)
  • Android 工作室海豚
  • android gradle 插件版本 7.3.1
  • 等级版本 7.4

Ara*_*ash 1

我正是这个问题,我所做的一切都无法解决它,所以我卸载了Android Studio,我手动删除了它的所有文件,旧版本和当前版本文件,Gradle文件等被删除,只保留了我的项目和sdk文件。然后我重新安装了 Android Studio 并下载了 Gradle 和更新,它就可以工作了。