Android Studio Error when adding Adobe Creative SDK

こ雲淡風輕ζ 提交于 2019-12-02 20:04:32

问题


This is my build.gradle file. I have followed this tutorial.

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

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    packagingOptions {
        exclude 'META-  INF/NOTICE.txt'
        exclude 'META-INF/LICENSE.txt'
    }

    defaultConfig {
        applicationId "com.example.test"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':libraries:collage-views')
    compile 'com.aviary.android.feather.sdk:aviary-sdk:3.6.5'
    compile 'com.adobe.creativesdk:behance:0.2.10'
    compile 'com.adobe.creativesdk:image:4.0.0'

    // Support libraries
    compile 'com.android.support:support-v4:21.0.3'
}

I am getting this error

Error:Failed to find: com.adobe.creativesdk:behance:0.2.10 Open File
Open in Project Structure dialog

Error:Failed to find: com.aviary.android.feather.sdk:aviary-sdk:3.6.5 Open File
Open in Project Structure dialog

Error:Failed to find: com.adobe.creativesdk:image:4.0.0 Open File
Open in Project Structure dialog

Do I need to give path of ${project.rootDir}/mvn-repo/release or need to download the sdk and add it somewhere manually? I'm new to android studio, so I don't know much about it.


回答1:


I have downloaded Adobe Creative SDK and put it inside the project folder in workspace. The folder name is "creativesdk-repo". Changed the URL in build.gradle file to this:

url "${project.rootDir}/creativesdk-repo"

(or whatever the name of the folder is)

Sync the build.gradle file and it works.

Don't forget to add this..

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



回答2:


Put downloaded sdk into root directory and add

maven {
         url "${project.rootDir}/creativesdk-repo"//your sdk name as it is
      } 

in Application's build.grade file under the "allprojects/repositories" section: as follow

allprojects {
    repositories {
        mavenCentral()
        jcenter()

        maven {
            url "${project.rootDir}/creativesdk-repo" 
        }
    }
}

make sure to add the packaging options to the Application's build.grade file under the "android" section:

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


来源:https://stackoverflow.com/questions/28261118/android-studio-error-when-adding-adobe-creative-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!