Question

I am facing an issue while adding project library in android studio
here is my project structure

MyApp
- app
- libraries
-- library

in root settings.gradle:

include ':app' include 'libraries:library' 

And in app gradle.build:

dependencies {
compile 'com.android.support:appcompat-v7:+'
compile project(':libraries:library')
}

and I'm getting this error:

A problem occurred configuring project ':app'. > Configuration with name 'default' not found.

Was it helpful?

Solution

Make sure your library module has its own build.gradle file inside it. It happens when any of your module inside the project doesn't have its build.gradle file.

Your Project structure should look like this

|+----Your_Project
  |+---libraries
  |   +--library
  |      +--src
  |      +--res
  |      --build.gradle
  |      --AndroidManifest.xml
  |+---app
       +--src
       +--res
       --build.gradle
  |---settings.gradle
  |---build.gradle

OTHER TIPS

I opened up the search all command in my project using the double shift hotkey and searched for import module.

I found it at the bottom of the list and clicked it. This worked differently (not to mention properly) from adding a module from the module settings screen.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top