android-ClassNotFoundException即将出现AppBarLayout,CoordinatorLayout
作者:互联网
当实现Material Design并在XML中使用AppBarLayout时,将在应用程序的运行时为AppBarLayout,CoordinatorLayout等提供ClassNotFoundException.代码编译良好.
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.CoordinatorLayout" on path: DexPathList[[zip file "/data/app/com.sivag1.juiceboard-1/base.apk"],nativeLibraryDirectories=[/data/app/com.sivag1.juiceboard-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 android.view.LayoutInflater.createView(LayoutInflater.java:583)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:255)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
解决方法:
确保包括AppBarLayout和CoordinatorLayout所需的Android设计库.
dependencies {
compile 'com.android.support:design:23.0.1'
}
标签:material-design,android 来源: https://codeday.me/bug/20191119/2033528.html