2

I'm trying to migrate my Android projects from Eclipse to Android Studio. I have a library project which is used in other projects and that's the reason I want it to be separated (not copied in the project). To do this I followed this answer. But I get the following error:

Error:Configuration with name 'default' not found.

I read and tried all the answers on Internet for this error but nothing fixed my problem.

settings.gradle

include ':my_android_app'
include ':my_android_project_lib'
project(':my_android_project_lib').projectDir = new File(settingsDir, '../my_android_project_lib')

build.gradle for my_android_app module

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "my.android.app"
        minSdkVersion 15
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(path: ':my_android_project_lib')
}

build.gradle for my_android_app project

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Edit: This answer helped me to fix the problem. I had to add the dependencies to the project's build.gradle file.

Community
  • 1
  • 1
Mario Kutlev
  • 4,897
  • 7
  • 44
  • 62
  • Can you try to provide more info/log with the `gradle tasks --info` command as said in this answer : http://stackoverflow.com/a/19583096/1387484 ? Maybe we will find important clues :) – mithrop Jan 22 '15 at 15:19
  • I am having exact same problem, could you please tell me how did you solve it? – Tony Dec 10 '15 at 12:23
  • What dependincies have you added to your project's build.gradle file? – Tony Dec 10 '15 at 12:38

1 Answers1

2

Could you comple with "gradles tasks --info" and see what you've got ?

Otherwise, here you might have something helpfull.

Cheers !

Community
  • 1
  • 1
Kansen
  • 183
  • 1
  • 11