I need to use Amazon Maps and Amazon Messaging in my apps.
With gradle, I did not succeed in adding the Amazon dependencies with a "provided" scope as they need to be :
The JAR file contains stub implementations of the Amazon Maps API. It does not contain actual implementations of the Maps API classes, so you should not compile the JAR into your app.
None of the solutions provided by Amazon support worked for me.
If someone succeeded to use amazon maps or amazon messaging with Gradle, please share your build.gradle file here.
In the 2.12 release of Gradle,
compileOnly
was added to give similar functionality toprovided
scope. There is a difference in what happens in the test classpath. Here is relevant quote and snippet from the release notes:There's now a great plugin from Netflix, gradle-extra-configurations-plugin. It provides a
provided
andoptional
scope. No more manual plumbing necessary and also generates the required metadata when pubishing e.g to a maven repository.There is a prodeps plugin which adds additional optional and provided dependency configurations for Gradle
The solution that I've been using is pretty simple. You must add the following code to your build.gradle file:
If you are not an Eclipse user (I'm not), you don't actually need the first and last lines, as you might have guessed.
Once the above configuration additions are in, you can then simply add a provided dependency in your dependencies section alongside of any regular compile dependencies:
Hope that helps. It's been working quite well for me for some time.
A little late to the show, using gradle you copy the .jar to the libs folder and in your gradle file you have: