1

I can not import libraries in my project, always appears the following error:

Error:Configuration with name 'default' not found.

settings.gradle

include ':app'
include ':libraries:library'

build-gradle

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile project(':libraries:library')
}

I am using:

UPDATE (NOT WORKS)

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.getbase:floatingactionbutton:1.4.0'
    compile project(':libraries:library')
}

ERROR

Error:A problem occurred configuring project ':app'.
> Cannot evaluate module library : Configuration with name 'default' not found.
Aspicas
  • 4,498
  • 4
  • 30
  • 53
  • 1
    Your problem probably lies elsewhere in your `build.gradle` file, either for the app or the library. Have you tried using `compile 'com.getbase:floatingactionbutton:1.4.0'` rather than a local copy of the library, to see if that changes your results? – CommonsWare Dec 30 '14 at 14:27
  • @CommonsWare I'll try that and I tell you – Aspicas Dec 30 '14 at 14:50
  • @CommonsWare Edited, not works... same Error – Aspicas Dec 30 '14 at 14:56
  • @CommonsWare I have tried adding other libraries and always the same error (edited above) appears, I think I must be doing something wrong at the time of import....any suggestions? – Aspicas Dec 30 '14 at 15:13
  • I agree with GreyBeardedGeek's duplicate link -- the problem probably lies in how `:libraries:library` is set up. – CommonsWare Dec 30 '14 at 15:15
  • @CommonsWare so, I should rename "build.gradle" that is within my library other than the default one? – Aspicas Dec 30 '14 at 15:23
  • No, but your `build.gradle` in `:libraries:library` would need to be correctly set up. – CommonsWare Dec 30 '14 at 15:43
  • @CommonsWare I look like an idiot, but I really do not know how set-up correctly `build.gradle` in: `libraries: library` ... I am new to Android Studio, please, Can you help me do that? I am so sorry and Thanks for your time. – Aspicas Dec 30 '14 at 15:50
  • 1
    If you had Android Studio create the module for you, it should already have `build.gradle` there. Beyond that, you would need to edit your question to post `build.gradle` from the library. If the library does not have a `build.gradle` file, that is probably the source of your problem right there. – CommonsWare Dec 30 '14 at 15:56

1 Answers1

2

As the page that you linked to says,

Just add the dependency to your build.gradle:

dependencies { compile 'com.getbase:floatingactionbutton:1.4.0' }

Also, probably a duplicate of Configuration with name 'default' not found while building android project on gradle

Community
  • 1
  • 1
GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
  • I added the dependency to my build.gradle, not works... same error. I going to read your link. Thanks – Aspicas Dec 30 '14 at 14:58