How to use Library from GitHub in android App

449 views Asked by At

I downloaded this library to use in my app, however, I can't get Android Studio to do the gradle build now. Anytime I try, I get "error:configuration with name 'default' not found". I've tried several other StackOverflow answers, but I still can't compile.

My dependencies (from build.gradle Module: app)

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:22.1.1'
compile project(":aFileDialog")
}

My settings.gradle:

include ':app'
include ':aFileDialog'

I have the library file in the root under "aFileDialog"

How can I get this to build with the library?

2

There are 2 answers

0
Yodamann On BEST ANSWER

I found a tutorial that worked: http://www.theappguruz.com/tutorial/library-project-module-as-dependency-in-android-studio/

In addition to the instructions given, I had to add the following line to my Manifest:

    tools:replace = "icon, label"
0
Dalija Prasnikar On

You have add path to your aFileDialog library in your settings.gradle

Make sure that folder you point to includes build.gradle file

include ':app'
include ':aFileDialog'
project(':aFileDialog').projectDir = new File(settingsDir, 'aFileDialog')

or (judging from the library folder structure on GitHub)

project(':aFileDialog').projectDir = new File(settingsDir, 'aFileDialog/library')