java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
突然间,当我尝试编译我的项目和 运行 我的应用程序时,我开始收到此 运行 时间错误 -
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.access0(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)
这是我试过的做法:
1) 从我的所有依赖项中排除 support-v4 并手动指定旧版本,支持 compile 'com.android.support:support-v4:21.+'
.
有趣的是 MainActivity 不是我的启动器 activity。因此该应用程序在启动器 activity 中运行良好。但是一旦 mainactivity 打开,它就会失败。
下面给出了我的 build.gradle(我不得不稍微弄乱它来修复另一个 another design library bug,所以不要介意排除)
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'
}
从您公开的所有排除项来看,我不得不说我读到的是您刚刚禁止 support-v4
和 support-v7
从您的应用程序中(甚至从 design
和 appcompat
).
所以尽量把它们放在最后^^
compile 'com.android.support:appcompat-v7:22.2.0' // no exclusion
只需启用 multidex。那对我有用。请关注link
对我来说,解决方案一直在添加
android:name="android.support.multidex.MultiDexApplication"
到清单
突然间,当我尝试编译我的项目和 运行 我的应用程序时,我开始收到此 运行 时间错误 -
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.access0(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)
这是我试过的做法:
1) 从我的所有依赖项中排除 support-v4 并手动指定旧版本,支持 compile 'com.android.support:support-v4:21.+'
.
有趣的是 MainActivity 不是我的启动器 activity。因此该应用程序在启动器 activity 中运行良好。但是一旦 mainactivity 打开,它就会失败。
下面给出了我的 build.gradle(我不得不稍微弄乱它来修复另一个 another design library bug,所以不要介意排除)
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'
}
从您公开的所有排除项来看,我不得不说我读到的是您刚刚禁止 support-v4
和 support-v7
从您的应用程序中(甚至从 design
和 appcompat
).
所以尽量把它们放在最后^^
compile 'com.android.support:appcompat-v7:22.2.0' // no exclusion
只需启用 multidex。那对我有用。请关注link
对我来说,解决方案一直在添加
android:name="android.support.multidex.MultiDexApplication"
到清单