ClassNotFound:android.view.ViewStructure with Support Library 26.0.2 – 27.0.0

前端之家收集整理的这篇文章主要介绍了ClassNotFound:android.view.ViewStructure with Support Library 26.0.2 – 27.0.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我发现搭载 Android 4.4.2的三星Galaxy S5出现了崩溃
NoClassDefFoundError: android/view/ViewStructure

自从我将支持库更新到26.0.2以来,这种情况一直在发生.现在它也发生在27.0.0,即使我预计这些问题已在其中得到解决.在将应用程序提交到Google Play之后不久,我发现Crashlytics发生了一次崩溃(我正在推广给我的一小部分用户).我不知道重现的具体步骤是什么.到目前为止,我已经假设它可能是在应用程序启动时.

相关报道:

java.lang.NoClassDefFoundError: android/graphics/drawable/Icon

ViewDebug.getExportedPropertyMethods java.lang.NoClassDefFound android/graphics/drawable/Icon

我使用的是支持库27.0.0,compileSdkVersion 27,targetSdkVersion 25,buildToolsVersion ’26 .0.2′,android插件2.3.3,gradle 3.3,Android Studio 3.0. (我猜这个问题与旧版本的gradle和插件无关?…)

我可以在支持库中看到ViewStructure用于:

android.support.design.widget.TextInputLayout 
android.support.design.testutils.ViewStructureImpl

但是,我没有在我的项目中的任何位置使用ViewStructure.

Fatal Exception: java.lang.NoClassDefFoundError: android/view/ViewStructure
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)
Caused by java.lang.ClassNotFoundException: Didn't find class "android.view.ViewStructure" on path: DexPathList[[zip file "/data/app/package.name-1.apk"],nativeLibraryDirectories=[/data/app-lib/package.name-1,/vendor/lib,/system/lib]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)

解决方法

导致此问题的最可能原因是用户不是常规用户,因为“只有在连接了hierarchyviewer / ddm时才会出现这种情况”.

更多信息可以在这里找到:

https://issuetracker.google.com/issues/68796830

原文链接:https://www.f2er.com/android/315691.html

猜你在找的Android相关文章