1

我正在尝试使用新的 Abode Creative SKD,但使用的是 Eclipse 而不是 Android Studio。

如何在我的 Eclipse 项目中添加以下库:

4.1 Adding the library dependency
In the build.gradle file of the app add the required library as a dependency.
EX: If you need to use authentication library you will need to add the below path under dependencies:
compile 'com.adobe.creativesdk.foundation:auth:0.2.10'
You can choose all or any of this according to your project requirements:
Authentication : 'com.adobe.creativesdk.foundation:auth:0.2.10'
Asset Browser : 'com.adobe.creativesdk.foundation:assets:0.2.10'
Behance : 'com.adobe.creativesdk:behance:0.2.10'
Image : 'com.adobe.creativesdk:image:4.0.0'
Note: com.adobe.creativesdk.foundation:auth is a basic requirement for any of the libraries.

从这个链接

我的项目中已经有了这个文件:build:grade

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}


allprojects {
    apply plugin: 'maven'

    tasks.withType(JavaCompile) {
        options.incremental = true
    }

    repositories {
        mavenCentral()
        jcenter()

        maven {
            url "${project.rootDir}/creativesdk-repo"  //ADD THE CORRECT LOCATION OF THE CREATIVESDK LIBRARY FILES
        }

    }
}

apply plugin: 'android'

dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    compile 'com.adobe.creativesdk:behance:0.2.10'
    compile 'com.adobe.creativesdk.foundation:auth:0.2.10'
    compile 'com.adobe.creativesdk.foundation:assets:0.2.10'
}

android {
    compileSdkVersion "android-21"
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "com.adobe.creativesdk.sample"
        minSdkVersion 14
        targetSdkVersion 21
        versionName "1.0.0"
        versionCode 1
    }

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

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

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }

    lintOptions {
        abortOnError false
    }
}
4

1 回答 1

0

使用蚂蚁?没门。当然,您可以解压缩在 Abode Creative SKD 中找到的 aars 并将文件放入,以便 ANT 可以使用它们。您甚至可以使用该文件创建一个库项目并将其包含在内(ANT 风格:) 但这很不方便。

我已经对类似问题进行了一些调查 - 如何在 Eclipse 中使用 aar 和 ANT。我终于下载了 Eclipse 库项目(有那个选项 - 选择 aar 或 Eclipse 库项目)并将其添加到 Eclipse 中。除了资产之外,所有工作都很好 - 他们需要在项目内部复制 apk (而不是库)本身。

就我自己而言,我不建议在不久的将来使用 ANT,因为即使是 android 开发人员也推迟了对它的支持。android 开发者网站上有一个功能汇总表(问我会搜索它),很明显,对 ANT 的支持被推迟了,而 Gradle 方向是首选的。不久前我搬到了 Gradle,我可以说,它比 ANT 好得多。完全没有依赖关系的噩梦。这非常重要,因为现代库可以包含数十个依赖项。手动搜索、添加和版本控制是一场噩梦。

于 2015-02-11T20:27:39.843 回答