Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuration with name 'default' not found. Android Studio

I have an Android Studio app. It has a library dependency (Android-Bootstrap), when I try to sync gradle, it gives me an error:

Configuration with name 'default' not found.

My structure is:

-FTPBackup    -fotobackup      -build.gradle    -Libraries      -Android-Bootstrap        -Settings.gradle        -build.gradle -Settings.gradle -Build.gradle 

The FTPBackup settings.gradle and build.gradle:

include ':fotobackup' include ':libraries:Android-Bootstrap',':Android-Bootstrap' 

// Top-level build file where you can add configuration options common to all sub-projects/modules.  buildscript {     repositories {         mavenCentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:0.9.+'     } }  allprojects {     repositories {         mavenCentral()     } } 

And the build.gradle inside fotobackup is:

apply plugin: 'android'  android {     compileSdkVersion 19     buildToolsVersion '19.0.3'      defaultConfig {         minSdkVersion 14         targetSdkVersion 19         versionCode 1         versionName "1.0"     }     buildTypes {         release {             runProguard false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'         }     } }  apply plugin: 'android'  dependencies {     compile fileTree(dir: 'libs', include: ['*.jar'])     compile 'com.android.support:support-v4:+'     compile project (':libraries:Android-Bootstrap') } 

The library is downloaded from https://github.com/Bearded-Hen/Android-Bootstrap and it has build.gradle, settings etc.

whats wrong?

like image 955
colymore Avatar asked Mar 20 '14 23:03

colymore


People also ask

Where is Configure option in Android Studio?

Open your project in Android Studio and select File > Settings... > Build, Execution, Deployment > Build Tools > Gradle (Android Studio > Preferences... > Build, Execution, Deployment > Build Tools > Gradle on a Mac).

How do I fix gradle settings?

For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project click on the Sync Project with Gradle files option. This will automatically download the new Gradle files and will fix the issue which is caused by the Gradle files.

What is default config in Android Studio?

Specifies defaults for properties that the Android application plugin applies to all build variants. Specifies defaults for properties that the Android dynamic-feature plugin applies to all build variants. Specifies defaults for properties that the Android library plugin applies to all build variants.


1 Answers

For one, it doesn't do good to have more than one settings.gradle file -- it only looks at the top-level one.

When you get this "Configuration with name 'default' not found" error, it's really confusing, but what it means is that Gradle is looking for a module (or a build.gradle) file someplace, and it's not finding it. In your case, you have this in your settings.gradle file:

include ':libraries:Android-Bootstrap',':Android-Bootstrap' 

which is making Gradle look for a library at FTPBackup/libraries/Android-Bootstrap. If you're on a case-sensitive filesystem (and you haven't mistyped Libraries in your question when you meant libraries), it may not find FTPBackup/Libraries/Android-Bootstrap because of the case difference. It's also looking for another library at FTPBackup/Android-Bootstrap, and it's definitely not going to find one because that directory isn't there.

This should work:

include ':Libraries:Android-Bootstrap' 

You need the same case-sensitive spec in your dependencies block:

compile project (':Libraries:Android-Bootstrap') 
like image 173
Scott Barta Avatar answered Oct 02 '22 00:10

Scott Barta