Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 983
Anjana Deegoda Avatar asked Nov 18 '17 07:11

Anjana Deegoda


2 Answers

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

like image 73
Developer Avatar answered Oct 19 '22 20:10

Developer


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

like image 27
ReGaSLZR Avatar answered Oct 19 '22 18:10

ReGaSLZR