Je reçois le message d'erreur lorsque je lance l'inspecteur de disposition: "Erreur lors de l'obtention de la hiérarchie des vues: erreur inattendue: hiérarchie des vues vides".
Il existe également une exception dans Logcat:
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater I/art: Exception thrown by dispatcher for 0x56555254
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: Java.lang.NoClassDefFoundError: Android.graphics.drawable.Icon
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at libcore.reflect.InternalNames.getClass(InternalNames.Java:55)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.Class.getDexCacheType(Class.Java:479)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.reflect.ArtMethod.getDexCacheType(ArtMethod.Java:236)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.reflect.ArtMethod.getParameterTypes(ArtMethod.Java:176)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.reflect.Method.getParameterTypes(Method.Java:174)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.Class.getDeclaredMethods(Class.Java:802)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.Java:1118)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.exportMethods(ViewDebug.Java:1209)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewProperties(ViewDebug.Java:1155)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewProperties(ViewDebug.Java:1141)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpView(ViewDebug.Java:1058)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:997)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dumpViewHierarchy(ViewDebug.Java:992)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.view.ViewDebug.dump(ViewDebug.Java:855)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.ddm.DdmHandleViewDebug.dumpHierarchy(DdmHandleViewDebug.Java:235)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Android.ddm.DdmHandleViewDebug.handleChunk(DdmHandleViewDebug.Java:134)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at org.Apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.Java:171)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: Caused by: Java.lang.ClassNotFoundException: Didn't find class "Android.graphics.drawable.Icon" on path: DexPathList[[Zip file "/data/app/com.tst.nikita.yandextranslater-2/base.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_dependencies_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_0_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_1_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_2_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_3_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_4_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_5_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_6_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_7_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_8_apk.apk", Zip file "/data/app/com.tst.nikita.yandextranslater-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.tst.nikita.yandextranslater-2/lib/arm, /vendor/lib, /system/lib]]
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.Java:56)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.ClassLoader.loadClass(ClassLoader.Java:511)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.ClassLoader.loadClass(ClassLoader.Java:469)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at libcore.reflect.InternalNames.getClass(InternalNames.Java:53)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: ... 24 more
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: Suppressed: Java.lang.ClassNotFoundException: Android.graphics.drawable.Icon
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.Class.classForName(Native Method)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.BootClassLoader.findClass(ClassLoader.Java:781)
12-10 23:46:56.812 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.BootClassLoader.loadClass(ClassLoader.Java:841)
12-10 23:46:56.822 18833-18840/com.tst.nikita.yandextranslater W/System.err: at Java.lang.ClassLoader.loadClass(ClassLoader.Java:504)
12-10 23:46:56.822 18833-18840/com.tst.nikita.yandextranslater W/System.err: ... 26 more
12-10 23:46:56.822 18833-18840/com.tst.nikita.yandextranslater W/System.err: Caused by: Java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
J'utilise Android Studio 3.0.1.
Appareil - Samsung Galaxy S4 GT-I9505 avec Android 5.0.1.
Du fichier manifeste:
compileSdkVersion 26
buildToolsVersion '26.0.3'
minSdkVersion 21
targetSdkVersion 26
J'ai remarqué que cela peut également se produire lors de l'utilisation de Bluetooth. Lorsque j'ai désactivé Bluetooth pour que mon code cesse de scanner, je pouvais capturer la hiérarchie de vues très bien.