0

I am using the BottomSheet library to create the BottomSheet menu as explained in Google documentation.

I added the BottomSheet library to my project but when I sync with gradle then I am getting error message. I tried all the answers listed at Error: Configuration with name 'default' not found in Android Studio and other solutions listed on stackoverflow but the issue still persists.

Here are build.gradle and settings files of my project:

BottomSheet/build.gradle

buildscript {
    repositories {
        jcenter()
    }

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

allprojects {
    group = POM_GROUP_ID
    version = POM_VERSION

    repositories {
        jcenter()
      }

    tasks.withType(JavaCompile) {
        options.encoding = "UTF-8"
    }
}


task wrapper(type: Wrapper) {
    gradleVersion = '1.12'
}

app/build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.khsingh.stockysingh"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile "com.android.support:appcompat-v7:21.0.+"
    compile project(":BottomSheet")



}

root/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

    }
}

allprojects {
    repositories {
        jcenter()
    }
}

settings.gradle

include ':app', ':BottomSheet'
project(':BottomSheet').projectDir = new File('library/BottomSheet')
Community
  • 1
  • 1

1 Answers1

0

Add this to your app/build.gradle

compile 'com.cocosw:bottomsheet:1.+@aar'

If in any case, you want to have the full library inc source codes in your app, download the library source codes as described then:

  1. Right click on your app's root in android Studio (left view)
  2. Select "Open Module Settings"
  3. Select the "+" icon on the top left of the new Window
  4. Select "import from gradle/eclipse project".

Now the library should be in your Workspace.

  1. Select your app from the list of modules
  2. Click on "Dependencies"
  3. Click on the green "+" on the right and select "library dependency"
  4. Select the BottomSheets library
  5. Apply

Android Studio should now, automatically insert the library to your app and sync successfully

tddmonkey
  • 20,798
  • 10
  • 58
  • 67
X7S
  • 409
  • 1
  • 4
  • 10