gradle 构建期间的 Aviary-SDK 错误 (Android)

Aviary-SDK error during gradle build (Android)

我已经复制了 Aviary 设置指南的每一步。在 Gradle 构建期间,它给了我这个:

Error:Configuration with name 'default' not found.

安装指南:

Adobe Creative SDK Documentation
Aviary SDK | Android Documentation

文件:

settings.gradle:

include ':app'

build.gradle(模块:应用)



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


快速旁注: 上面链接的 Aviary SDK 文档已删除。)

更新:版本说明0.9.7

Creative SDK 图像编辑器(以前称为 Aviary)现在作为远程 Maven 存储库提供。本部分是配置 gradle.

的更新说明

在你的项目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
}

在您的 模块 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 Getting Started guide

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配置的区别,包括上面的代码,在this section the Creative SDK Getting Started guide for Android.

使用 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)