Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuration with name 'default' not found while building android project on gradle

Tags:

android

gradle

I am trying to import eclipse project into android studio, but its giving this error.

Could not fetch model of type 'IdeaProject' using Gradle installation 'D:\gradle-1.7'.
A problem occurred configuring root project 'HealthCity'.
A problem occurred configuring root project 'HealthCity'.
Failed to notify project evaluation listener.
Configuration with name 'default' not found.

the same error is there when i try to manually build the project.

below is my settings.gradle

include ':ActionBarSherlock',':FacebookSDK',':library',':NineOldAndroids',':google-play-services_lib',':viewflow'

project(':ActionBarSherlock').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/ActionBarSherlock')
project(':FacebookSDK').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/FacebookSDK')
project(':library').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/library')
project(':NineOldAndroids').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/NineOldAndroids')
project(':google-play-services_lib').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/google-play-services_lib')
project(':viewflow').projectDir = new File('C:/Users/Ankit/workspace/workspace-client-gemoro-2/viewflow')

here is my build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5+'
    }
}
apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':ActionBarSherlock')
    compile project(':FacebookSDK')
    compile project(':library')
    compile project(':NineOldAndroids')
    compile project(':google-play-services_lib')
    compile project(':viewflow')
}

android {
    compileSdkVersion 16
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 16
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        instrumentTest.setRoot('tests')
    }
}
like image 594
Ankit Avatar asked Aug 12 '13 01:08

Ankit


People also ask

What is default configuration in gradle?

The default configuration extends from the runtime configuration, which means that it contains all the dependencies and artifacts of the runtime configuration, and potentially more. You can add dependencies and artifacts in the usual way (using a dependencies / artifacts block in B's build script).


1 Answers

So, you need to make sure that each submodule in your project has its own build.gradle file. The name 'default' happens because your outer build.gradle is trying to build a project that doesn't know how to build itself, thus it is given the name 'default.' Try doing that and see what happens.

like image 181
astryk Avatar answered Oct 14 '22 15:10

astryk