2

我一直在尝试正确导入此库以开始为我的应用程序编写图像编辑组件。我目前在根目录中有下载的“creativesdk-repo”文件夹,并按照本教程的说明进行操作: https ://creativesdk.adobe.com/docs/android/#/articles/gettingstarted/index.html 。

还有本教程: https ://creativesdk.adobe.com/docs/android/#/articles/imageediting/index.html

当我简单地使用基本授权库时,构建没有问题,但我的应用程序需要照片编辑能力。我的首要问题(在众多问题中)在于应用程序的 build.gradle 文件(而不是包含项目的 build.gradle 文件)。

这是我的 build.gradle 文件中的代码:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.0"

    defaultConfig {
        applicationId "com.example"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
    compile 'com.adobe.creativesdk.image:4.0.0'
}

最后一行导致出现错误消息:

错误:无法解决:com.adobe.creativesdk.image:4.0.0:打开文件

我相信这些消息意味着 Adob​​e Creative SDK 库的图像编辑部分未被识别。我什至用 Adob​​e 的示例项目对此进行了测试,它遇到了同样的问题。我可以做些什么来解决这个问题并开始编写我的应用程序的这一部分?

4

5 回答 5

6

您需要将 creative-sdk repo 从下载链接下载到您的项目文件夹中。在项目 gradle 中定义 creative-sdk repo url,如下所示:

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

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

allprojects {
    repositories {
        mavenCentral()
        jcenter()
        maven{
            url "${project.rootDir}/creativesdk-repo" //ADD THE CORRECT LOCATION OF THE CREATIVESDK LIBRARY FILES
        }

    }

}

在您的应用程序 build.gradle 中定义:

  compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
  compile 'com.adobe.creativesdk:image:4.0.0'

您应该扩展您的 Application 类并实现它,如下所示:

public class ExampleApplication extends MultiDexApplication implements IAdobeAuthClientCredentials , IAviaryClientCredentials {
    private static final String CREATIVE_SDK_SAMPLE_CLIENT_ID = "62bbd145c3f54ee39151823358c83e28";
    private static final String CREATIVE_SDK_SAMPLE_CLIENT_SECRET = "2522a432-dfc8-40c4-94fe-646e10223562";        

    @Override
    public void onCreate() {
        super.onCreate();       
        AdobeCSDKFoundation.initializeCSDKFoundation(getApplicationContext());

    }

    @Override
    public String getClientID() {
        return CREATIVE_SDK_SAMPLE_CLIENT_ID;
    }

    @Override
    public String getClientSecret() {
        return CREATIVE_SDK_SAMPLE_CLIENT_SECRET;
    }

    @Override
    public String getBillingKey() {
        return "";
    }        

}

在 Application 标记内的 AndroidManifest.xml 中放置以下内容:

 <provider
            android:name="com.aviary.android.feather.sdk.internal.cds.AviaryCdsProvider"
            android:authorities="com.package.AviaryCdsProvider"
            android:exported="false"
            android:process=":aviary_cds" />

使用此配置,您可以使用以下命令调用 Aviary Sdk Activity:

 Intent newIntent = new AviaryIntent.Builder(this);
//config values
startActivity(newIntent);

我像这样配置SDK,它的工作原理。抱歉耽搁了。

2016 年 10 月 10 日更新:

感谢阿什瑞恩:

尝试使用 Adob​​e Creative SDK Image Editing 制作 Android Studio 应用程序,无法在 gradle 中编译库

于 2015-04-12T20:14:01.660 回答
3

用这个:

//noinspection SpellCheckingInspection
repositories {
    // ...
    // For Adobe Creative SDK
    maven { url 'https://repo.adobe.com/nexus/content/repositories/releases/' }
}

来源:https ://creativesdk.adobe.com/docs/android/#/articles/gettingstarted/index.html

于 2016-10-10T10:33:06.857 回答
1

我认为你的错误在这里。改变:

complie 'com.adobe.creativesdk.image:4.0.0'

为了这:

compile 'com.adobe.creativesdk.image:4.0.0'

这是一个简单的 sintax 错误。

2016 年 10 月 10 日更新:

感谢阿什瑞恩:

尝试使用 Adob​​e Creative SDK Image Editing 制作 Android Studio 应用程序,无法在 gradle 中编译库

于 2015-04-09T08:08:38.243 回答
1

请确保在全球项目回购下。如果不是 gradle 则无法找到路径。

allprojects {
    repositories {

 compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
 compile 'com.adobe.creativesdk:image:4.0.0'

}
于 2016-01-29T01:33:25.670 回答
0

只需在 Module:app build.gradle 文件中使用最新的 lib 依赖项并更新您的 android sdk 和 android studio

编译 'com.adobe.creativesdk:image:4.6.3'

于 2016-09-07T05:07:22.620 回答