when i create new project the project run successfully but after that when i exit android studio
and reopen the project comes up with this error
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
- android studio dolphin
- android gradle plugin version 7.3.1
- gradle version 7.4
3
Answers
What I experienced is a bit different, but it may help your case. Here is my environment: Dolphin patch 1, Gradle 7.3.1, latest dependencies, Windows 11, Java 1_8. My project launched and okay. Then I tweaked some code, like changing position of a button, when ran again, I got aapt2 error. I did Build->Clean Project, ran again and still got this aapt2 error. So I closed the project, quit Studio, restarted Windows, then started Studio,load the project, and ran again, it passed debug and launched and everything was okay. I still do not know though, why restarting Windows fix the aapt2 error. I’ll leave to the development team to find the answer, it may have to do with cache or temp file or what….
I had exactly this problem, everything I did couldn’t solve it, so I uninstalled Android Studio, I deleted all its files manually, old versions and current version files, Gradle files etc. was deleted, only my projects and sdk files was remained. Then I reinstalled Android Studio and downloaded Gradle and updates, and it works.
I had the exact same error, though maybe not for the same reason as the OP.
In my case I was attempting to set up a KMM library, and in the only
build.gradle.kts
in my project I had:adding
google()
solved the problem for me.To be clear, this
repositories
element was not withinbuildScript
or any other element.