Home » Android » android – Unable to resolve dependency error

android – Unable to resolve dependency error

Posted by: admin May 14, 2020 Leave a comment

Questions:

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 ‘:[email protected]/compileClasspath’: Could not resolve project :markerlessAR1.
Open File
Show Details

How to&Answers:

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).

Answer:

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’))