Anjana Deegoda
Anjana Deegoda

Reputation: 169

Unable to resolve dependency error

I've imported a unity android project as module to my existing android studio project and came up with these errors while gradle syncing.

Error:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :markerlessAR1. Open File
Show Details

Upvotes: 11

Views: 902

Answers (2)

Developer
Developer

Reputation: 151

Try below steps to resolve this error:

1) Import AAR file in native android app from File -> Project structure -> add new aar package.

2) After successfully synced,make sure that your AAR module contain build.gradle file. For example: UnityAAR is your module name containing unityaar.aar file, build.gradle file.

3) If module gradle file is missing, add on your own. Gradle file contains configurations.maybeCreate("default") artifacts.add("default", file('unityaar.aar'))

Upvotes: 2

ReGaSLZR
ReGaSLZR

Reputation: 413

I've solved the case on my end. The classes.jar was missing from my AAR file (didn't find that .jar when I 'unzipped' the AAR). So what I did was I rebuilt my AAR file by re-executing gradlew assemble and then imported this new AAR into my Android application project.

As for why the classes.jar was missing from my first AAR file, I have yet to uncover the mystery of that. I think I forgot to execute the gradle command and just picked the available AAR file from the newly created Android module out of the Unity-exported application project (because I was too excited).

Upvotes: 2

Related Questions