2

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'
}


4

2 回答 2

1

使用 Gradle,设置 Aviary 非常简单。仅当您不打算自定义 SDK 时才采用此方法。否则,您需要将 SDK 作为自己的模块添加到项目目录中。请参阅第 4.2 节以深入了解这一点。

首先,在 Android Studio 中打开应用程序的 build.gradle 文件。请注意,这与您的根项目的 build.gradle 文件不同。

确保在存储库块中,您同时拥有 Maven Central 和 Aviary 的 Maven 存储库。它应该看起来像这样:

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

在同一个文件中,将以下内容添加到依赖项块中,以便使用 Aviary SDK 构建您的项目:

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

最后,在 android 块中的 packagingOptions 中,添加以下内容以防止重复复制这些文件:

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

以下是 build.gradle 文件的外观示例:

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'
}

(注意 minSdkVersion 是 10。)

于 2016-03-29T13:17:29.410 回答
1

快速旁注:上面链接的 Aviary SDK 文档已被弃用。)

更新:版本说明0.9.7

Creative SDK 图像编辑器(以前称为 Aviary)现在作为远程 Maven 存储库提供。本节是配置 gradle 的更新说明。

在您的Project build.gradle中,添加以下代码(请参阅注释):

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
}

在您的Module build.gradle中,添加以下代码(请参阅注释):

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'
}

详细信息可在Creative SDK for Android 入门指南中找到。

旧说明0.7.329及以下

您的模块 build.gradle看起来不错。您还需要一个项目 build.gradle文件:

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
}

这两种配置之间的差异gradle.build(包括上面的代码)在本节的 Creative SDK Getting Started guide for Android中进行了介绍。

于 2016-02-23T15:45:23.753 回答