{"id":823,"date":"2025-07-26T08:48:25","date_gmt":"2025-07-26T08:48:25","guid":{"rendered":"https:\/\/nurlandroid.com\/?p=823"},"modified":"2025-07-26T08:48:26","modified_gmt":"2025-07-26T08:48:26","slug":"anr-%d0%b2-android-%d0%b5-%d0%ba%d0%b0%d0%ba-%d0%be%d0%bd-%d0%bf%d0%be%d1%8f%d0%b2%d0%bb%d1%8f%d0%b5%d1%82%d1%81%d1%8f-%d0%bf%d0%be%d0%b4-%d0%ba%d0%b0%d0%bf%d0%be%d1%82%d0%be%d0%bc","status":"publish","type":"post","link":"https:\/\/nurlandroid.com\/?p=823","title":{"rendered":"ANR \u0432 Android-\u0435, \u043a\u0430\u043a \u043e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c?"},"content":{"rendered":"\n<p>\u041e\u0442\u0432\u0435\u0442: ANR \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <strong>\u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong>.<\/p>\n\n\n\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>5 \u0441\u0435\u043a\u0443\u043d\u0434<\/strong> \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 <strong>UI \u043f\u043e\u0442\u043e\u043a\u0430<\/strong><\/li>\n\n\n\n<li><strong>10 \u0441\u0435\u043a\u0443\u043d\u0434<\/strong> \u0434\u043b\u044f <code>BroadcastReceiver<\/code><\/li>\n\n\n\n<li><strong>20 \u0441\u0435\u043a\u0443\u043d\u0434<\/strong> \u0434\u043b\u044f <code>Service<\/code><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u041a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 <strong>\u0432\u043d\u0443\u0442\u0440\u0438 Android<\/strong>?<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">1. ActivityManagerService (AMS) \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 responsiveness<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0412\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (<code>startActivity<\/code>, <code>broadcast<\/code>, <code>service<\/code>) \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0447\u0435\u0440\u0435\u0437 <code>ActivityManagerService<\/code> (\u0432 System Server)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">2. InputDispatcher \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u0430\u043f\u0430\u0435\u0442 \u044d\u043a\u0440\u0430\u043d \u2014 <code>InputDispatcher<\/code> (\u0432 native-\u0441\u0435\u0440\u0432\u0435\u0440\u0435 input&#8217;\u043e\u0432) \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 <strong>UI-\u043f\u043e\u0442\u043e\u043a<\/strong> \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 Binder<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. Looper main\/UI thread \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0415\u0441\u043b\u0438 UI-\u043f\u043e\u0442\u043e\u043a \u0437\u0430\u043d\u044f\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u043b\u0433\u0438\u0439 <code>onCreate()<\/code>, <code>onDraw()<\/code>, <code>onTouch()<\/code> \u0438\u043b\u0438 <code>BroadcastReceiver<\/code>) \u2014 \u043e\u043d <strong>\u043d\u0435 \u0443\u0441\u043f\u0435\u0432\u0430\u0435\u0442 \u043e\u0442\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/strong>, \u0447\u0442\u043e \u0436\u0438\u0432<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. Watchdog \u0441\u043b\u0435\u0434\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442 \u0431\u044b\u043b \u0432 \u0441\u0440\u043e\u043a<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0412 <code>system_server<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code>Watchdog<\/code>-\u0442\u0440\u0435\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439:\n<ul class=\"wp-block-list\">\n<li>\u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432\u0441\u0435\u0445 handler&#8217;\u043e\u0432 (<code>AMS<\/code>, <code>WMS<\/code>, \u0438 \u043f\u0440.)<\/li>\n\n\n\n<li>\u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u2192 <strong>\u043f\u0438\u0448\u0435\u0442 ANR<\/strong>, \u0434\u0435\u043b\u0430\u0435\u0442 <code>dropbox<\/code>, <code>tombstone<\/code>, \u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5. AMS \u0441\u043e\u0437\u0434\u0430\u0451\u0442 ANR \u043e\u0442\u0447\u0451\u0442<\/h4>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0432 \u0441\u0440\u043e\u043a:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>AMS \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>appNotResponding()<\/code><\/li>\n\n\n\n<li>\u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f <code>traces.txt<\/code> \u0441\u043e \u0441\u0442\u0435\u043a\u043e\u043c \u0432\u0441\u0435\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432<\/li>\n\n\n\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>\/data\/anr\/<\/code><\/li>\n\n\n\n<li>\u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f UI-\u0434\u0438\u0430\u043b\u043e\u0433: &#171;\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442. \u041f\u043e\u0434\u043e\u0436\u0434\u0430\u0442\u044c\/\u0417\u0430\u043a\u0440\u044b\u0442\u044c&#187;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0442\u0432\u0435\u0442: ANR \u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e: \u041a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 Android? 1. ActivityManagerService (AMS) \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 responsiveness 2. InputDispatcher \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 3. Looper main\/UI thread \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 4. Watchdog \u0441\u043b\u0435\u0434\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442 \u0431\u044b\u043b \u0432 \u0441\u0440\u043e\u043a 5. AMS \u0441\u043e\u0437\u0434\u0430\u0451\u0442 ANR [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-823","post","type-post","status-publish","format-standard","hentry","category-android"],"_links":{"self":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=823"}],"version-history":[{"count":1,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/823\/revisions"}],"predecessor-version":[{"id":824,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=\/wp\/v2\/posts\/823\/revisions\/824"}],"wp:attachment":[{"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nurlandroid.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}