web-dev-qa-db-de.com

NoClassDefFoundError Android/Unterstützung/v4/Animation/AnimatorCompatHelper

Nach dem Update von Android Studio auf 2.3.1 und Gradle 3.3 habe ich festgestellt, dass die App bei einer bestimmten Aktivität abstürzt. Vor dem Update war alles in Ordnung. Ich habe einen Tag mit diesem Ding verschwendet und ich kann wirklich nicht herausfinden, warum ich ein 'Java.lang.NoClassDefFoundError bekomme ; ' fatale Ausnahme.

Ich lade auch die wichtigsten Teile der build.gradle-Datei hoch

apply plugin: 'com.Android.application'

Android {
compileSdkVersion 23
buildToolsVersion Android_BUILD_TOOLS

defaultConfig {
    minSdkVersion 16
    targetSdkVersion Android_TARGET_SDK
}

signingConfigs {
    release {
       ....
    }
}

buildTypes {
    release {
       ...
    }
    debug {
        ..
    }
}

sourceSets.main {
   ..
}

flavorDimensions "abi", "countMode"
productFlavors {
    ...
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

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

 repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
   if (ENABLE_ABI_ARM7) armv7Compile project(path: ':countlib', configuration: 'armv7Release')
if (!USE_CUSTOM_OPENCV) {
    if (ENABLE_ABI_X86) x86Compile project(path: ':countlib', configuration: 'x86Release')
    if (ENABLE_ABI_ARM) armCompile project(path: ':countlib', configuration: 'armRelease')
    if (ENABLE_ABI_MIPS) mipsCompile project(path: ':countlib', configuration: 'mipsRelease')
}
compile project(':photoviewlib')

compile 'com.Android.support:appcompat-v7:23.1.0'
compile 'com.Android.support:design:23.1.0'
compile 'com.Android.support:recyclerview-v7:23.1.0'
compile 'com.google.Android.gms:play-services-drive:10.2.1'

// Include the sdk as a dependency
compile ('com.OneDrive.sdk:OneDrive-sdk-Android:1.2+') {
    transitive = false
}

// Include the gson dependency
compile ('com.google.code.gson:gson:2.3.1')

// Include supported authentication methods for your application
compile ('com.Microsoft.services.msa:msa-auth:0.8.+')
compile ('com.Microsoft.aad:adal:1.1.+')

// HTTP client
compile 'com.google.http-client:google-http-client-gson:1.20.0' exclude module: 'httpclient'

compile "com.github.danielnilsson9:color-picker-view:[email protected]"
compile 'com.github.crosswall:Android-Coverflow:release-v1.0.4'
compile 'com.dropbox.core:dropbox-core-sdk:2.1.2'
}

Hier ist der vollständige Ausnahmestapel:

Java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;
                                                                          at Android.support.v7.widget.DefaultItemAnimator.resetAnimation(DefaultItemAnimator.Java:513)
                                                                          at Android.support.v7.widget.DefaultItemAnimator.animateRemove(DefaultItemAnimator.Java:187)
                                                                          at Android.support.v7.widget.SimpleItemAnimator.animateDisappearance(SimpleItemAnimator.Java:86)
                                                                          at Android.support.v7.widget.RecyclerView.animateDisappearance(RecyclerView.Java:3046)
                                                                          at Android.support.v7.widget.RecyclerView.access$700(RecyclerView.Java:144)
                                                                          at Android.support.v7.widget.RecyclerView$4.processDisappeared(RecyclerView.Java:416)
                                                                          at Android.support.v7.widget.ViewInfoStore.process(ViewInfoStore.Java:201)
                                                                          at Android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.Java:2931)
                                                                          at Android.support.v7.widget.RecyclerView.onLayout(RecyclerView.Java:3071)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.LinearLayout.setChildFrame(LinearLayout.Java:1742)
                                                                          at Android.widget.LinearLayout.layoutVertical(LinearLayout.Java:1585)
                                                                          at Android.widget.LinearLayout.onLayout(LinearLayout.Java:1494)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.Java:1037)
                                                                          at Android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.Java:747)
                                                                          at Android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.Java:42)
                                                                          at Android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.Java:1133)
                                                                          at Android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.Java:760)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.Java:1192)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.FrameLayout.layoutChildren(FrameLayout.Java:344)
                                                                          at Android.widget.FrameLayout.onLayout(FrameLayout.Java:281)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.LinearLayout.setChildFrame(LinearLayout.Java:1742)
                                                                          at Android.widget.LinearLayout.layoutVertical(LinearLayout.Java:1585)
                                                                          at Android.widget.LinearLayout.onLayout(LinearLayout.Java:1494)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.FrameLayout.layoutChildren(FrameLayout.Java:344)
                                                                          at Android.widget.FrameLayout.onLayout(FrameLayout.Java:281)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.LinearLayout.setChildFrame(LinearLayout.Java:1742)
                                                                          at Android.widget.LinearLayout.layoutVertical(LinearLayout.Java:1585)
                                                                          at Android.widget.LinearLayout.onLayout(LinearLayout.Java:1494)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.widget.FrameLayout.layoutChildren(FrameLayout.Java:344)
                                                                          at Android.widget.FrameLayout.onLayout(FrameLayout.Java:281)
                                                                          at com.Android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.Java:3178)
                                                                          at Android.view.View.layout(View.Java:17945)
                                                                          at Android.view.ViewGroup.layout(ViewGroup.Java:5812)
                                                                          at Android.view.ViewRootImpl.performLayout(ViewRootImpl.Java:2716)
                                                                          at Android.view.ViewRootImpl.performTraversals(ViewRootImpl.Java:2417)
                                                                          at Android.view.ViewRootImpl.doTraversal(ViewRootImpl.Java:1487)
                                                                          at Android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.Java:7450)
                                                                          at Android.view.Choreographer$CallbackRecord.run(Choreographer.Java:920)
                                                                          at Android.view.Choreographer.doCallbacks(Choreographer.Java:695)
                                                                          at Android.view.Choreographer.doFrame(Choreographer.Java:631)
                                                                        at Android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographe
13
user5076870

Gelöst durch Folgen der Antwort auf diese Frage: Android Support Repo 46.0.0 mit Android Studio 2.3

Lösung:

Dieses Skript wurde am Ende von app.module in die Datei build.gradle eingefügt

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.Android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '24.1.0'
            }
        }
    }
}

Hoffe, das hilft anderen Menschen.

34
user5076870

Versuchen Sie dies, um den Fehler zu beheben

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.Android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}
0
Smit Patel