Marian Pa┼║dzioch Marian Pa┼║dzioch - 1 year ago 162
Android Question

Adding external library in Android studio

I want to add external library to my Android application (I use Android Studio, the instructions provided by lib author for Eclipse didn't work for Android Studio).

I've tried to do it with maven, so in File->Project Structure->Dependencies I've added

but Gradle Sync fails:

Error:Failed to find: com.foursquare:foursquare-android-nativeoauth-lib:1.0.0

When I try to build my app (without fixing above error becaus I don't know how) I get:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.foursquare:foursquare-android-nativeoauth-lib:1.0.0.
Required by:
> Could not parse POM
> Could not find any version that matches com.foursquare:parent:1.0.0.

Any other way to import this lib? I can simply copy-paste source code into my source or create JAR out of it?

BTW: if you run into problems see this question (I had this issue after importing): Manifest merger failed : uses-sdk:minSdkVersion 14

Answer Source

Try this:

Project Structure > Dependencies Tab > Add module dependency (scope = compile)

Where the module dependency is the project library android folder

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download