我一直在尝试正确导入此库,开始为我的应用程序编写图像编辑组件。我目前已经下载了' 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: 打开文件
我认为这些消息意味着无法识别Adobe Creative SDK库的图像编辑部分。我甚至用Adobe的示例项目测试了它,它遇到了同样的问题。我该怎么做才能解决这个问题并开始编写应用程序的这一部分?
答案 0 :(得分: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
}
}
}
在你的app 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日更新:
感谢Ash Ryan:
答案 1 :(得分: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
答案 2 :(得分:1)
我认为你的错误就在这里。变化:
complie 'com.adobe.creativesdk.image:4.0.0'
为此:
compile 'com.adobe.creativesdk.image:4.0.0'
这是一个简单的sintax错误。
2016年10月10日更新:
感谢Ash Ryan:
答案 3 :(得分:1)
请确保在全球项目回购中。如果没有gradle无法找到路径。
allprojects {
repositories {
compile 'com.adobe.creativesdk.foundation:auth:0.3.94'
compile 'com.adobe.creativesdk:image:4.0.0'
}
答案 4 :(得分:0)
在Module:app build.gradle文件中使用最新的lib依赖项并更新你的android sdk和android studio
编译'com.adobe.creativesdk:image:4.6.3'