11

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

ColdFire
  • 6,764
  • 6
  • 35
  • 51

2 Answers2

2

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

ReGaSLZR
  • 383
  • 4
  • 17
2

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

Developer
  • 151
  • 8