1

I'm trying to add library in Android Studio Project, but I am getting an error:

Error:Configuration with name 'default' not found.

All I have done is followed tutorials and guides from Stack Overflow

  1. First added the library to root of my project.

enter image description here

  1. then went to my settings.gradle and done that

    include ':app'
    include ':ImagePicker'
    project(':ImagePicker').projectDir = new File(settingsDir, '../ImagePicker/library')
    
  2. then went to my dependencies and in app.gradle

    compile project(':ImagePicker')
    

but still getting particular stated error.

Library Link

Muhammad Qais
  • 77
  • 1
  • 10

1 Answers1

2

There is a much better way to add this library to your project:

Add this permission to your AndroidManifest.xml:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    // Add this line
    maven { url "https://jitpack.io" }
  }
}

Add ImagePicker dependency to your app's build.gradle file:

dependencies{
    compile 'com.github.Mariovc:ImagePicker:1.2.0'
}

In that case you don't need to add the source code to your libray. This should also speedup your app compile time since the library doesn't need to be compiled again and again. So you will use the library as a normal dependency.

rekire
  • 47,260
  • 30
  • 167
  • 264