尝试使用 Adob​​e Creative SDK Image Editing 制作 Android Studio 应用程序,无法在 gradle 中编译库 [英] Trying to make an Android Studio Application with Adobe Creative SDK Image Editing, cannot get libraries compiled in gradle

查看:22
本文介绍了尝试使用 Adob​​e Creative SDK Image Editing 制作 Android Studio 应用程序,无法在 gradle 中编译库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I've been trying to properly import this library to begin writing an image editing component for my application. I currently have the downloaded 'creativesdk-repo' folder in the root directory, and have followed instructions according to this tutorial: https://creativesdk.adobe.com/docs/android/#/articles/gettingstarted/index.html.

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

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

There are no problems building when I simply use the basic authorization library, but my application needs photo editing capability. My foremost problem (among many) lies within the build.gradle file of the application (not the encompassing project build.gradle file).

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

Here is the code in my build.gradle file:

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

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

The very last line causes an error message to appear:

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

Error:Failed to resolve: com.adobe.creativesdk.image:4.0.0: Open File

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

I believe these messages mean that the image editing portion of the Adobe Creative SDK libraries are not being recognized. I have even tested this with example projects from Adobe and it runs into the same problem. What can I do to fix this and start writing this portion of my application?

推荐答案

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

You need download creative-sdk repo from download links into your project folder. In the project gradle define creative-sdk repo url like this:

    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 中定义:

In your app build.gradle define this:

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

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

You should extend your Application class and implement this, something like this:

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 "";
    }        

}

在你的 AndroidManifest.xml 里面的 Application 标签中输入:

In your AndroidManifest.xml inside Application tag put this:

 <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 活动:

With this configuration you can call Aviary Sdk Activity with this:

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

我像这样配置 SDK,并且它可以工作.抱歉耽搁了.

I configure SDK like this, and its working. Sorry for the delay.

2016 年 10 月 10 日更新:

UPDATE 10/10/2016:

感谢 Ash Ryan:

Thanks to Ash Ryan:

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

这篇关于尝试使用 Adob​​e Creative SDK Image Editing 制作 Android Studio 应用程序,无法在 gradle 中编译库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆