Android dependencies in .aar files not being imported to SDK
I had been working with some issues importing .aar files, and i would like to share some recommendations that work under this scenario
You have to add dependent AARs and JARs to the Binding project as well as main AAR file.
Use the plugin Xamarin.GradleBindings https://github.com/EgorBo/Xamarin.GradleBindings as it should resolve dependency and all its sub-dependencies and generate the binding project.
- Follow instructions: Menu (File -> New-> New Module -> Import .JAR/.AAR) and import your .AAR. The correct way (currently) to use a local AAR file as a build dependency is to use the module import wizard (File | New Module | Import .JAR or .AAR package) which will automatically add the .aar as a library module in your
- Then in the project build.gradle (not the top level one, the one under 'app') add the following (in the dependencies section):
- Name-Of-Your-Project should match the name of the folder that was added after you imported the AAR file (at the same level as app/.myname under the top most level folder). Or to put it another way...
build.gradle (here's where to add compile project(':ProjectName') to dependency section)
ProjectName (added automatically after importing, matching the name of your aar file)
- Sync Gradle (using toolbar button or in File->Synchronize) after you do this.
- You can also try placing the .aar locally and retry
Some interesting Public references:
Build your Android applications in Visual Studio using Gradle
Xamarin.Android Manual Installation
Launch the SDK Manager from Xamarin Studio
Hope it helps!