Aviary-SDK error during gradle build (Android)

921 views Asked by At

I have copied every single step of Aviary setup guide. During Gradle build, it gives me this:

Error:Configuration with name 'default' not found.

Installation Guide:

Adobe Creative SDK Documentation
Aviary SDK | Android Documentation

Files :

settings.gradle:

include ':app'

build.gradle(Module: app)



apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.adobe.logopros"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'com.adobe.creativesdk.foundation:auth:0.7.329'
    compile 'com.adobe.creativesdk:image:4.0.0'
}


2

There are 2 answers

1
vVv On BEST ANSWER

With Gradle, setting up with Aviary is extremely simple. Follow this approach only if you do not plan on customizing the SDK. Otherwise, you will need to add the SDK as its own module in your project directory. See section 4.2 for an in-depth walkthrough of this.

To start, open the build.gradle file of your Application in Android Studio. Please note that this is different from the build.gradle file of your root project.

Make sure that in the repositories block, you have both Maven Central and Aviary's Maven repository. It should look something like this:

repositories {
    mavenCentral()
    jcenter()
    mavenLocal()
    maven {
        name 'maven.aviary.com'
        url uri("http://maven.aviary.com/repo/release")
    }
}

In this same file, add the following to the dependencies block in order to build your project with the Aviary SDK:

compile 'com.aviary.android.feather.sdk:aviary-sdk:3.6.3'

Finally, within packagingOptions in the android block, add the following in order to prevent duplicate copying of these files:

exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'

Here is an example how the build.gradle file should look:

repositories {
    mavenCentral()
    jcenter()
    mavenLocal()
    maven {
        name 'maven.aviary.com'
        url uri("http://maven.aviary.com/repo/release")
    }
}

android {
    compileSdkVersion 20
    buildToolsVersion "20.0.0"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    packagingOptions {
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
    }

}

dependencies {
    compile 'com.aviary.android.feather.sdk:aviary-sdk:3.6.3'
}

(Note that the minSdkVersion is 10.)

0
Ash Ryan Arnwine On

(Quick sidenote: the Aviary SDK Documentation linked above is depricated.)

Update: instructions for version 0.9.7

The Creative SDK Image Editor (formerly known as Aviary) is now offered as a remote Maven repo. In this section are the updated instructions for configuring gradle.

In your Project build.gradle, add the code below (see the comments):

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

        /* 1) Add the Gradle Retrolambda Plugin */
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta3'

    }
}

allprojects {
    repositories {
        jcenter()

        /* 2) Add mavenCentral */
        mavenCentral()

        /* 3) Add the Creative SDK Maven repo URL */
        maven {
            url 'https://repo.adobe.com/nexus/content/repositories/releases/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

In your Module build.gradle, add the code below (see the comments):

apply plugin: 'com.android.application'

/* 1) Apply the Gradle Retrolambda Plugin */
apply plugin: 'me.tatarka.retrolambda'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.adobe.gettingstarted"
        minSdkVersion 16 // Minimum is 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    /* 2) Compile for Java 1.8 or greater */
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    /* 3) Exclude duplicate licenses */
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'
        pickFirst 'AndroidManifest.xml'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'

    /* 4) Add the CSDK framework dependencies (Make sure these version numbers are correct) */
    compile 'com.adobe.creativesdk.foundation:auth:0.9.7'
}

Details are available in the Creative SDK for Android Getting Started guide.

Old instructions for 0.7.329 and below

Your Module build.gradle looks fine. You will also need a Project build.gradle file:

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "${project.rootDir}/creativesdk-repo/release" // Location of the CSDK repo
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

The difference between the two gradle.build configurations, including the code above, is covered in this section the Creative SDK Getting Started guide for Android.