java.lang.NoClassDefFoundError的:android.support.v7.app.AppCompatDelegateImplV14 [英] java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14

查看:420
本文介绍了java.lang.NoClassDefFoundError的:android.support.v7.app.AppCompatDelegateImplV14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然,当我尝试编译我的项目,并运行我的应用程序,我开始收到此运行时错误 -

  java.lang.NoClassDefFoundError的:android.support.v7.app.AppCompatDelegateImplV14
            在android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
            在android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
            在android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
            在android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
            在com.example.shubhamkanodia.bookmybook.MainActivity.onCreate(MainActivity.java:70)
            在android.app.Activity.performCreate(Activity.java:5990)
            在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
            在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
            在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
            在android.app.ActivityThread.access $ 800(ActivityThread.java:151)
            在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1303)
            在android.os.Handler.dispatchMessage(Handler.java:102)
            在android.os.Looper.loop(Looper.java:135)
            在android.app.ActivityThread.main(ActivityThread.java:5254)
            在java.lang.reflect.Method.invoke(本机方法)
            在java.lang.reflect.Method.invoke(Method.java:372)
            在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903)
            在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
 

下面就是我试图做:

1)不支持-V4从我所有的依赖关系,并手动指定的旧版本,支持编译com.android.support:support-v4:21 +

什么是有趣的是, MainActivity不是我的发射活动。因此,应用程序工作正常发射活动。但只要mainactivity打开时,它失败。

我的build.gradle是如下(我不得不搞砸了一点点来解决另一个<一href="https://$c$c.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=175086"相对=nofollow>另一种设计库的bug 的,所以不介意不包括)

 编译('com.google.android.gms:玩-服务身份:7.5.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.android.support:palette-v7:22.2.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.nhaarman.listviewanimations:LIB-核心:3.1.0@aar'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    容易org.androidannotations:androidannotations:$ AAVersion
    编译(org.androidannotations:androidannotations-API:$ AAVersion)
            {
                排除模块:支持-V4
                排除模块:支持-V7

            }
    编译(com.android.support:appcompat-v7:22.2.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.android.support:cardview-v7:22.2.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.android.support:design:22.2.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编制项目(:cognalys)
    编译文件树(导演:库,包括:解析 -  *罐子)
    编译文件树(导演:库,包括:ParseCrashReporting  -  *罐子)
    编译(com.google.android.gms:播放服务加:7.5.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.parse.bolts:螺栓,机器人:1 +'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.squareup.picasso:毕加索:2.5.2'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.github.ksoichiro:Android的observablescrollview:1.5.1'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(me.dm7.bar codescanner:zbar:1.7.2'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.sothree.slidinguppanel:图书馆:3.0.0'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.mcxiaoke.volley:图书馆:1.0 +。'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译com.android.support:support-v4:21.+
    编译(jp.wasabeef:毕加索转换:1.0.3@aar'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(jp.co.cyberagent.android.gpuimage:gpuimage库:1.2.3@aar'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.daimajia.easing:图书馆:1.0.1@aar'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
    编译(com.daimajia.androidanimations:图书馆:1.1.3@aar'){
        排除模块:支持-V4
        排除模块:支持-V7

    }
 

解决方案

从你接触的例外,我不得不说,我读的是,你只是禁止支持-V4 支持-V7 从您的应用程序(甚至从设计 appcompat )。

所以尽量让他们在结束^^

 编译com.android.support:appcompat-v7:22.2.0'//没有排斥
 

All of a sudden, when I try to compile my project,and run my app, I start getting this runtime error-

java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
            at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
            at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
            at com.example.shubhamkanodia.bookmybook.MainActivity.onCreate(MainActivity.java:70)
            at android.app.Activity.performCreate(Activity.java:5990)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5254)
            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:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Here's what I've tried doing:

1) Excluding support-v4 from all my dependencies and manually specifying an older version, support compile 'com.android.support:support-v4:21.+'.

What is interesting to note is that MainActivity is not my launcher activity. So the app works fine in the launcher activity.. But as soon as mainactivity opens, it fails.

My build.gradle is given below (i had to mess it up a little to fix another another design library bug, so don't mind the excludes )

     compile('com.google.android.gms:play-services-identity:7.5.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.android.support:palette-v7:22.2.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.nhaarman.listviewanimations:lib-core:3.1.0@aar') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile ("org.androidannotations:androidannotations-api:$AAVersion")
            {
                exclude module: 'support-v4'
                exclude module: 'support-v7'

            }
    compile('com.android.support:appcompat-v7:22.2.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.android.support:cardview-v7:22.2.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.android.support:design:22.2.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile project(':cognalys')
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
    compile ('com.google.android.gms:play-services-plus:7.5.0'){
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile ('com.parse.bolts:bolts-android:1.+') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.squareup.picasso:picasso:2.5.2') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.github.ksoichiro:android-observablescrollview:1.5.1') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile ('me.dm7.barcodescanner:zbar:1.7.2') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.sothree.slidinguppanel:library:3.0.0') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile ('com.mcxiaoke.volley:library:1.0.+'){
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile 'com.android.support:support-v4:21.+'
    compile ('jp.wasabeef:picasso-transformations:1.0.3@aar'){
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile ('jp.co.cyberagent.android.gpuimage:gpuimage-library:1.2.3@aar'){
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile ('com.daimajia.easing:library:1.0.1@aar') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    }
    compile('com.daimajia.androidanimations:library:1.1.3@aar') {
        exclude module: 'support-v4'
        exclude module: 'support-v7'

    } 

解决方案

From all the exclusions you exposed, I have to say that what I read is that you just banned support-v4 and support-v7 from your application (even from design and appcompat).

So try to keep them at the end ^^

compile 'com.android.support:appcompat-v7:22.2.0' // no exclusion

这篇关于java.lang.NoClassDefFoundError的:android.support.v7.app.AppCompatDelegateImplV14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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