cardslib icon indicating copy to clipboard operation
cardslib copied to clipboard

Failed to resolve: com.github.gabrielemariotti.cards:library:1.9. in Build.grade

Open TeamBrainStorm opened this issue 8 years ago • 3 comments

Hello, I'm trying to add the cards library for my android app by adding this line to my projects build.grade file:

compile 'com.github.gabrielemariotti.cards:library:1.9.1' However when I re-sync the grade file i get this error:

Failed to resolve: com.github.gabrielemariotti.cards:library:1.9.1

heres my build.grade file:

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // Will compile all the Libraries inside the 'libs' folder
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.github.gabrielemariotti.cards:library:1.9.1'

}

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.0"

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the maintools source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }


}

I'm new to android studio so any help I can get on this error would be amazing!

Thanks a million in advance!

TeamBrainStorm avatar Jul 18 '15 22:07 TeamBrainStorm

What version of Android Studio are you running? Make sure you have the latest, stable version. Your build.gradle should look something like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "PACKAGE-NAME-HERE"
        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.1.1'
    compile 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
    compile 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
}

kedarv avatar Jul 19 '15 14:07 kedarv

The code sample you posted did not work I got the same error I'm running android studio version 1.3 RC3 any other suggestions? Please let me know

TeamBrainStorm avatar Jul 19 '15 15:07 TeamBrainStorm

http://stackoverflow.com/a/28711776/1116560 could be a possibility. Not sure, sorry!

kedarv avatar Jul 19 '15 15:07 kedarv