For a helping lib I use, I recently get:
Error:Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'mylib-release.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform
and then on gradle console:
Could not resolve all files for configuration ':demo:debugCompileClasspath'.
Failed to transform file 'mylib-release.aar' to match attributes {artifactType=android-exploded-aar} using transform ExtractAarTransform java.io.FileNotFoundException: mylib-release.aar (Datei oder Verzeichnis nicht gefunden)
It was working last week, unfortunately I forgot what changed
In my case it was the missing .aar file (or files, depending on how many buildtypes you have), as @JBTPublic pointed out.
So how did I fix it? Well, you need to generate it by yourself. At least for me, Android Studio doesn't generate it by itself. I had imported an Android library onto my project, and it was working perfectly well in a Linux environment. But I forgot that I needed to generate the AAR file before running my Android app.
To generate the AAR file, if you have an Android Library as a dependency for your project, you need to:
your-android-library/build.gradle
Build -> Make Module 'your-android-library'
Once the Make is done (you'll see a Build SUCCESSFUL
message), then you are all set up to Run your Android app as you normally do.
Hint: Add this info into your Readme file, in order for you not to forget once you change environment, like I did just last night before going for a trip.
In my case this error was due to that .aar was missing so in your case check that your lib mylib-release.aar exists and is found in the debug compileClasspath.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With