使用AppCompat 23时遇到NoClassDefFoundError



 dalvikvm                                     Could not find class 'android.support.v7.app.AppCompatDelegateImplV23', referenced from method android.support.v7.app.AppCompatDelegate.create
dalvikvm                                     Could not find class 'android.support.v7.app.AppCompatDelegateImplV14', referenced from method android.support.v7.app.AppCompatDelegate.create
dalvikvm                                     Could not find class 'android.support.v7.app.AppCompatDelegateImplV11', referenced from method android.support.v7.app.AppCompatDelegate.create
dalvikvm                                     Could not find class 'android.support.v7.app.AppCompatDelegateImplV7', referenced from method android.support.v7.app.AppCompatDelegate.create
AndroidRuntime                               FATAL EXCEPTION: main
AndroidRuntime                               java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
AndroidRuntime                               at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:135)
AndroidRuntime                               at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:117)
AndroidRuntime                               at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:456)
AndroidRuntime                               at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:59)

错误代码如上,提示的是Delegate错误,百度了一下说这个用来弄ToolBar,但是运行时闪退+报错

Android google开发者工具 library

popshao 9 years, 5 months ago

这个有可能是编译SDK版本问题,试一下把依赖库和项目的编译SDK版本调到一致,而且最好不要太低版本.

GMN丶RYU answered 9 years, 5 months ago

Your Answer