How can i fix this error in android Adobe SDK Tool

2019-03-30 17:16发布

问题:

I have integrated Adobe Editor in my android application it was working fine, After updating my android studio, it is crashing

i added in gradle

android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
    multiDexEnabled true
    minSdkVersion 21
    targetSdkVersion 26

    versionName computeVersionName()
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    applicationId 'package.name'
    versionCode 3
    manifestPlaceholders = [appPackageName: "${applicationId}"]

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath true
        }
    }
}

i added dependancy in gradle app

implementation 'com.adobe.creativesdk:image:4.6.3'

i also added a classpath in gradle project

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
        mavenLocal()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'io.fabric.tools:gradle:1.19.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
    }
}
allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://repo.adobe.com/nexus/content/repositories/releases/'
            maven { url 'https://jitpack.io' }
            maven {
                url 'http://maven.localytics.com/public'
            }
        }

        google()
    }
}

then they return this error when i am using adobe sdk tool

java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/os/AsyncTaskCompat;
at com.adobe.creativesdk.aviary.AdobeImageEditorActivityAbstract.loadTools(AdobeImageEditorActivityAbstract.java:764)
at com.adobe.creativesdk.aviary.AdobeImageEditorActivityAbstract.onPostCreate(AdobeImageEditorActivityAbstract.java:581)
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1201)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3137)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3263)
at android.app.ActivityThread.access$1000(ActivityThread.java:197)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1687)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6897)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.os.AsyncTaskCompat" on path: DexPathList[[zip file "/data/app/technology.novapex.pikard-1/base.apk"],nativeLibraryDirectories=[/data/app/technology.novapex.pikard-1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.adobe.creativesdk.aviary.AdobeImageEditorActivityAbstract.loadTools(AdobeImageEditorActivityAbstract.java:764) 
at com.adobe.creativesdk.aviary.AdobeImageEditorActivityAbstract.onPostCreate(AdobeImageEditorActivityAbstract.java:581) 
at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1201) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3137) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3263) 
at android.app.ActivityThread.access$1000(ActivityThread.java:197) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1687) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6897) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
Suppressed: java.lang.ClassNotFoundException: android.support.v4.os.AsyncTaskCompat
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

they return this error in the integration of android Sdk tools

回答1:

See https://stackoverflow.com/a/48136955/1833539 for a solution. You simply need to restore the deprecated classes.

There is no better solution because Adobe stopped the support/development of these Adobe UI components (Photo Editor, ...).