Android Studio Gradle Configuration with Name 'Default' Not Found

Error: Configuration with name 'default' not found in Android Studio

Add your library folder in your root location of your project and copy all the library files there. For ex YourProject/library then sync it and rest things seems OK to me.

Gradle sync Error:Configuration with name 'default' not found

You should have a structure like this:

projectRoot
app
build.gradle
library
build.gradle
build.gradle
settings.gradle

Each module has own build.gradle file. Also the root/settings.gradle defines all modules inside a project. Don't use another settings.gradle inside your module.

In settings.gradle :

include ':app', ':library'

In build.gradle

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

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

In library/build.gradle

apply plugin: 'com.android.library'

android {
compileSdkVersion ...
buildToolsVersion ...

defaultConfig {
....
}

}

dependencies {
//....
}

In app/build.gradle use your file but change:

dependencies {
//...
// GuillotineMenu
compile project(":library")
}

UPDATE:

After your comment below, I think that in your case the library folder is the root folder of another project.
It means that you should refer to the module inside this project.

    projectRoot
app
build.gradle
libs
guillotinemenu
build.gradle //top level file of guillotinemenu project
-->> module
build.gradle //build.gradle of the module

So change the settings.gradle of your projectRoot.

 include ':app', ':guillotinemenu'
project(':guillotinemenu').projectDir = new File('libs/guillotinemenu/module')

The module (libs/guillotinemenu/module) should have a build.gradle as the library/build.gradle described above.

Gradle build error Configuration with name 'default' not found.

What worked for me was.

  1. Download the library as.zip from GitHub and extract it somewhere.
  2. In Android Studio go to File -> New -> Import Module and then select the extracted folder.
  3. Uncheck the import sample checkbox
  4. Give it some relevant name.
  5. Sync/build the project.
  6. In the build.gradle of the app, add line compile project(':name-you-gave')
  7. Sync/build the project again.

See the solution here

Android Studio Gradle sync failed: Configuration with name 'default' not found


Project repo: https://github.com/erincandescent/Impeller

You can't build this project without doing same changes.

In the settings.gradle there are:

include ':impellerapi'
include ':jiraconnect-android-main'
include ':tokenautocomplete:library'The settings.gradle

and it is not clear what is include ':impellerapi'.

Also in the root folder there are files like AndroidManifest.xml or res folder that shouldn't be there.

Also the build.gradle in the root folder is not a top-level file, it is just a module build.gradle.

It looks like a module was pushed in the root folder instead of a module folder.

Also the project is very old, and you have to update all the components inside the build.gradle for example:

dependencies {
classpath 'com.android.tools.build:gradle:0.13.+'
}

Error:Configuration with name 'default' not found when trying to import project as library into Android Studio

That twowayview-master build.gradle file isn't a buildscript for a standalone module; it lacks any sort of apply plugin statement that would tell Gradle how it should compile something. This looks like the top-level build file of a multimodule-structured project. In your settings.gradle file, you should point at the module in the project you're trying to include, not the build file at the top level.

Configuration with name 'default' not found error on Android Studio

In your settings.gradle (ProjectA) you are referring the wrong folder.

include ':LibraryA'
project(':LibraryA').projectDir = new File('../LibraryA')

Checking your image, the LibraryA folder is a root folder.

Gradle is searching for a "module" build.gradle while in this folder there is a top-level file configuration.

You have to refer to the module inside the LibraryA

project(':LibraryA').projectDir = new File('../LibraryA/app')

Of course you have to pay attention if some tasks or variable are defined in the top-level file (LibraryA). In this case you have to clone them inside your top-level file (ProjectA)



Related Topics



Leave a reply



Submit