{"id":1375,"date":"2025-05-27T06:02:00","date_gmt":"2025-05-26T21:02:00","guid":{"rendered":"https:\/\/itstudy365.com\/blog\/?p=1375"},"modified":"2025-05-27T06:08:47","modified_gmt":"2025-05-26T21:08:47","slug":"android-application-development-%e7%ac%ac27%e7%ab%a0%ef%bc%9alogcat%e3%81%ae%e8%aa%ad%e3%81%bf%e6%96%b9%e3%81%a8%e3%83%88%e3%83%a9%e3%83%96%e3%83%ab%e3%82%b7%e3%83%a5%e3%83%bc%e3%83%86%e3%82%a3","status":"publish","type":"post","link":"https:\/\/itstudy365.com\/blog\/2025\/05\/27\/android-application-development-%e7%ac%ac27%e7%ab%a0%ef%bc%9alogcat%e3%81%ae%e8%aa%ad%e3%81%bf%e6%96%b9%e3%81%a8%e3%83%88%e3%83%a9%e3%83%96%e3%83%ab%e3%82%b7%e3%83%a5%e3%83%bc%e3%83%86%e3%82%a3\/","title":{"rendered":"Android application development \u7b2c27\u7ae0\uff1aLogcat\u306e\u8aad\u307f\u65b9\u3068\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0"},"content":{"rendered":"\n<button id=\"bb1\" type=\"button\" value=\"Play\" class=\"responsivevoice-button\" title=\"ResponsiveVoice Tap to Start\/Stop Speech\"><span>&#128266; Play<\/span><\/button>\n        <script>\n            bb1.onclick = function(){\n                if(responsiveVoice.isPlaying()){\n                    responsiveVoice.cancel();\n                }else{\n                    responsiveVoice.speak(\"\ud83d\udd0d Logcat\u3068\u306f\uff1f Logcat\uff08\u30ed\u30b0\u30ad\u30e3\u30c3\u30c8\uff09 \u306f\u3001Android\u30a2\u30d7\u30ea\u306e\u52d5\u4f5c\u4e2d\u306b\u767a\u751f\u3059\u308b\u30ed\u30b0\uff08\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8868\u793a\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002Java\u3067\u8a00\u3048\u3070 System.out.println() \u3092\u3082\u3063\u3068\u5f37\u529b\u306b\u3057\u305f\u3082\u306e\u3001\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002 Android Studio\u3067\u306f\u3001\u300cLogcat\u300d\u30bf\u30d6\u304b\u3089\u30ed\u30b0\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002 \ud83d\udccb Logcat\u306e\u57fa\u672c\u69cb\u6210 Logcat\u306e1\u884c\u306e\u30ed\u30b0\u306f\u3001\u3056\u3063\u304f\u308a\u6b21\u306e\u3088\u3046\u306a\u60c5\u5831\u3092\u542b\u3093\u3067\u3044\u307e\u3059\uff1a 2025-05-14 14:22:35.123 12345-12345\/com.example.app D\/MainActivity: \u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f \u90e8\u5206\u5185\u5bb92025-05-14 14:22:35.123\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d712345-12345\u30d7\u30ed\u30bb\u30b9ID\u3068\u30b9\u30ec\u30c3\u30c9IDcom.example.app\u30a2\u30d7\u30ea\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u540dD\u30ed\u30b0\u30ec\u30d9\u30eb\uff08\u5f8c\u8ff0\uff09MainActivity\u30ed\u30b0\u51fa\u529b\u5143\u306e\u30bf\u30b0\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\u5b9f\u969b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8 \ud83e\udded \u30ed\u30b0\u30ec\u30d9\u30eb\u306e\u610f\u5473 \u30ed\u30b0\u306b\u306f\u512a\u5148\u5ea6\uff08\u30ed\u30b0\u30ec\u30d9\u30eb\uff09\u304c\u3042\u308a\u3001\u6b21\u306e\u3088\u3046\u306b\u5206\u985e\u3055\u308c\u307e\u3059\uff1a \u30ec\u30d9\u30eb\u8aac\u660e\u7528\u9014\u306e\u4f8bV (Verbose)\u4e00\u756a\u8a73\u7d30\u3001\u57fa\u672c\u5168\u51fa\u529b\u30c7\u30d0\u30c3\u30b0\u4e2d\u306e\u60c5\u5831\u3059\u3079\u3066D (Debug)\u30c7\u30d0\u30c3\u30b0\u7528\u60c5\u5831\u51e6\u7406\u306e\u6d41\u308c\u3001\u5909\u6570\u306e\u78ba\u8a8d\u306a\u3069I (Info)\u72b6\u614b\u5909\u5316\u306a\u3069\u306e\u60c5\u5831\u8d77\u52d5\u6210\u529f\u3001\u753b\u9762\u9077\u79fb\u901a\u77e5\u306a\u3069W (Warn)\u8b66\u544a\u3060\u304c\u81f4\u547d\u7684\u3067\u306f\u306a\u3044\u975e\u63a8\u5968API\u4f7f\u7528\u3001\u8a2d\u5b9a\u30df\u30b9\u306a\u3069E (Error)\u30a8\u30e9\u30fc\u767a\u751f\u4f8b\u5916\u3001\u30af\u30e9\u30c3\u30b7\u30e5\u306a\u3069A (Assert)\u901a\u5e38\u306f\u4f7f\u7528\u3057\u306a\u3044\u91cd\u5927\u306a\u5931\u6557\u691c\u51fa\u7528\uff08\u958b\u767a\u4e2d\uff09 \ud83d\udee0\ufe0f Log\u51fa\u529b\u306e\u66f8\u304d\u65b9\uff08Java\uff09 \u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001Log \u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u51fa\u529b\u3057\u307e\u3059\uff1a Log.d(\\\"MainActivity\\\", \\\"\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f\\\"); Log.e(\\\"LoginActivity\\\", \\\"\u30ed\u30b0\u30a4\u30f3\u5931\u6557\\\", e); \/\/ \u4f8b\u5916\u4ed8\u304d \u30e1\u30bd\u30c3\u30c9\u30ed\u30b0\u30ec\u30d9\u30ebLog.v()VerboseLog.d()DebugLog.i()InfoLog.w()WarnLog.e()Error \u30bf\u30b0\uff08\u7b2c\u4e00\u5f15\u6570\uff09 \u306f\u901a\u5e38\u3001\u30af\u30e9\u30b9\u540d\u3084\u753b\u9762\u540d\u3092\u5165\u308c\u307e\u3059\u3002\u30ed\u30b0\u691c\u7d22\u6642\u306b\u4fbf\u5229\u3067\u3059\u3002 \ud83d\udd0e \u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u9032\u3081\u65b9 \u2460 \u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306e\u78ba\u8a8d\u65b9\u6cd5 Logcat\u3067 E\uff08Error\uff09\u30ec\u30d9\u30eb\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0 Exception \u3084 Caused by: \u3092\u63a2\u3059 \u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u4e0a\u304b\u3089\u9806\u306b\u78ba\u8a8d \u81ea\u5206\u306e\u30a2\u30d7\u30ea\u306e\u30af\u30e9\u30b9\u540d\u3092\u542b\u3080\u884c\u3092\u63a2\u3059 E\/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.app, PID: 12345 java.lang.NullPointerException: Attempt to invoke method on null object at com.example.app.MainActivity.onCreate(MainActivity.java:42) \u3053\u3053\u3067\u6ce8\u76ee\u3059\u308b\u306e\u306f \u2192 MainActivity.java:42\u2192 42\u884c\u76ee\u3067 null \u3092\u53c2\u7167\u3057\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u2461 \u3088\u304f\u3042\u308b\u30c8\u30e9\u30d6\u30eb\u4f8b\u3068\u30ed\u30b0\u306e\u898b\u65b9 \u30c8\u30e9\u30d6\u30eb\u5178\u578b\u30ed\u30b0\u4f8b\u539f\u56e0\u3068\u5bfe\u7b56NullPointerExceptionAttempt to invoke...\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3044ActivityNotFoundExceptionUnable to find explicit activity classAndroidManifest.xml \u306b\u5b9a\u7fa9\u6f0f\u308cNetworkOnMainThreadExceptionandroid.os.NetworkOnMainThreadException\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u3092UI\u30b9\u30ec\u30c3\u30c9\u3067\u884c\u3063\u3066\u3044\u308bClassCastExceptionjava.lang.ClassCastExceptionfindViewById() \u306e\u30ad\u30e3\u30b9\u30c8\u30df\u30b9Resources$NotFoundExceptionresource ID not found\u5b58\u5728\u3057\u306a\u3044\u30ea\u30bd\u30fc\u30b9\u3092\u53c2\u7167\u3057\u3066\u3044\u308b \ud83c\udf9b\ufe0f Logcat\u306e\u30d5\u30a3\u30eb\u30bf\u6d3b\u7528 Android Studio\u306eLogcat\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\uff1a \u30ed\u30b0\u30ec\u30d9\u30eb\u306e\u7d5e\u308a\u8fbc\u307f\uff08Debug\u3001Error\u306a\u3069\uff09 \u7279\u5b9a\u30bf\u30b0\u306e\u307f\u8868\u793a \u7279\u5b9a\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u691c\u7d22\uff08\u4f8b: \\\"Exception\\\"\uff09 \u73fe\u5728\u5b9f\u884c\u4e2d\u306e\u30a2\u30d7\u30ea\u306e\u30ed\u30b0\u306e\u307f\u8868\u793a \ud83d\udc49 \u307e\u305a\u306f \\\"Show only selected application\\\" \u3092\u30aa\u30f3\u306b\u3057\u3066\u3001\u81ea\u5206\u306e\u30a2\u30d7\u30ea\u306e\u30ed\u30b0\u306b\u7d5e\u308b\u306e\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002 \ud83e\uddf9 \u30c7\u30d0\u30c3\u30b0\u304c\u843d\u3061\u7740\u3044\u305f\u3089\u2026 \u30c7\u30d0\u30c3\u30b0\u6642\u306f Log.d() \u3092\u591a\u7528\u3057\u307e\u3059\u304c\u3001\u672c\u756a\u30d3\u30eb\u30c9\u3067\u306f\u3053\u308c\u3089\u3092\u51fa\u529b\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002 Gradle\u306e\u30d3\u30eb\u30c9\u30bf\u30a4\u30d7\u3084 BuildConfig.DEBUG \u3092\u4f7f\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\uff1a if (BuildConfig.DEBUG) { Log.d(\\\"DebugTag\\\", \\\"\u3053\u3053\u306f\u958b\u767a\u4e2d\u3060\u3051\u51fa\u3059\\\"); } \u2705 \u307e\u3068\u3081 \u30dd\u30a4\u30f3\u30c8Logcat \u306f Android \u306e\u6a19\u6e96\u30ed\u30b0\u8868\u793a\u30c4\u30fc\u30eb\u30ed\u30b0\u30ec\u30d9\u30eb\u306f V, D, I, W, E \u304c\u57fa\u672cLog.d() \u306a\u3069\u3067\u51fa\u529b\u3001\u30bf\u30b0\u540d\u3067\u6574\u7406\u3059\u308b\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306f E\/AndroidRuntime \u3092\u63a2\u3059Logcat \u30d5\u30a3\u30eb\u30bf\u3067\u52b9\u7387\u7684\u306b\u30c8\u30e9\u30d6\u30eb\u5bfe\u5fdc\", \"Japanese Female\");\n                }\n            };\n        <\/script>\n    <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd0d Logcat\u3068\u306f\uff1f<\/h2>\n\n\n\n<p><strong>Logcat\uff08\u30ed\u30b0\u30ad\u30e3\u30c3\u30c8\uff09<\/strong> \u306f\u3001Android\u30a2\u30d7\u30ea\u306e\u52d5\u4f5c\u4e2d\u306b\u767a\u751f\u3059\u308b\u30ed\u30b0\uff08\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u8868\u793a\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002Java\u3067\u8a00\u3048\u3070 <code>System.out.println()<\/code> \u3092\u3082\u3063\u3068\u5f37\u529b\u306b\u3057\u305f\u3082\u306e\u3001\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n\n\n\n<p>Android Studio\u3067\u306f\u3001\u300cLogcat\u300d\u30bf\u30d6\u304b\u3089\u30ed\u30b0\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccb Logcat\u306e\u57fa\u672c\u69cb\u6210<\/h2>\n\n\n\n<p>Logcat\u306e1\u884c\u306e\u30ed\u30b0\u306f\u3001\u3056\u3063\u304f\u308a\u6b21\u306e\u3088\u3046\u306a\u60c5\u5831\u3092\u542b\u3093\u3067\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\" data-show-lang=\"0\"><code>2025-05-14 14:22:35.123 12345-12345\/com.example.app D\/MainActivity: \u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u90e8\u5206<\/th><th>\u5185\u5bb9<\/th><\/tr><\/thead><tbody><tr><td><code>2025-05-14 14:22:35.123<\/code><\/td><td>\u30ed\u30b0\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7<\/td><\/tr><tr><td><code>12345-12345<\/code><\/td><td>\u30d7\u30ed\u30bb\u30b9ID\u3068\u30b9\u30ec\u30c3\u30c9ID<\/td><\/tr><tr><td><code>com.example.app<\/code><\/td><td>\u30a2\u30d7\u30ea\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u540d<\/td><\/tr><tr><td><code>D<\/code><\/td><td>\u30ed\u30b0\u30ec\u30d9\u30eb\uff08\u5f8c\u8ff0\uff09<\/td><\/tr><tr><td><code>MainActivity<\/code><\/td><td>\u30ed\u30b0\u51fa\u529b\u5143\u306e\u30bf\u30b0<\/td><\/tr><tr><td><code>\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f<\/code><\/td><td>\u5b9f\u969b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udded \u30ed\u30b0\u30ec\u30d9\u30eb\u306e\u610f\u5473<\/h2>\n\n\n\n<p>\u30ed\u30b0\u306b\u306f\u512a\u5148\u5ea6\uff08\u30ed\u30b0\u30ec\u30d9\u30eb\uff09\u304c\u3042\u308a\u3001\u6b21\u306e\u3088\u3046\u306b\u5206\u985e\u3055\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u30ec\u30d9\u30eb<\/th><th>\u8aac\u660e<\/th><th>\u7528\u9014\u306e\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><strong>V<\/strong> (Verbose)<\/td><td>\u4e00\u756a\u8a73\u7d30\u3001\u57fa\u672c\u5168\u51fa\u529b<\/td><td>\u30c7\u30d0\u30c3\u30b0\u4e2d\u306e\u60c5\u5831\u3059\u3079\u3066<\/td><\/tr><tr><td><strong>D<\/strong> (Debug)<\/td><td>\u30c7\u30d0\u30c3\u30b0\u7528\u60c5\u5831<\/td><td>\u51e6\u7406\u306e\u6d41\u308c\u3001\u5909\u6570\u306e\u78ba\u8a8d\u306a\u3069<\/td><\/tr><tr><td><strong>I<\/strong> (Info)<\/td><td>\u72b6\u614b\u5909\u5316\u306a\u3069\u306e\u60c5\u5831<\/td><td>\u8d77\u52d5\u6210\u529f\u3001\u753b\u9762\u9077\u79fb\u901a\u77e5\u306a\u3069<\/td><\/tr><tr><td><strong>W<\/strong> (Warn)<\/td><td>\u8b66\u544a\u3060\u304c\u81f4\u547d\u7684\u3067\u306f\u306a\u3044<\/td><td>\u975e\u63a8\u5968API\u4f7f\u7528\u3001\u8a2d\u5b9a\u30df\u30b9\u306a\u3069<\/td><\/tr><tr><td><strong>E<\/strong> (Error)<\/td><td>\u30a8\u30e9\u30fc\u767a\u751f<\/td><td>\u4f8b\u5916\u3001\u30af\u30e9\u30c3\u30b7\u30e5\u306a\u3069<\/td><\/tr><tr><td><strong>A<\/strong> (Assert)<\/td><td>\u901a\u5e38\u306f\u4f7f\u7528\u3057\u306a\u3044<\/td><td>\u91cd\u5927\u306a\u5931\u6557\u691c\u51fa\u7528\uff08\u958b\u767a\u4e2d\uff09<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee0\ufe0f Log\u51fa\u529b\u306e\u66f8\u304d\u65b9\uff08Java\uff09<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001<code>Log<\/code> \u30af\u30e9\u30b9\u3092\u4f7f\u3063\u3066\u51fa\u529b\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\" data-show-lang=\"0\"><code>Log.d(&quot;MainActivity&quot;, &quot;\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u307e\u3057\u305f&quot;);\nLog.e(&quot;LoginActivity&quot;, &quot;\u30ed\u30b0\u30a4\u30f3\u5931\u6557&quot;, e); \/\/ \u4f8b\u5916\u4ed8\u304d<\/code><\/pre><\/div>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u30e1\u30bd\u30c3\u30c9<\/th><th>\u30ed\u30b0\u30ec\u30d9\u30eb<\/th><\/tr><\/thead><tbody><tr><td><code>Log.v()<\/code><\/td><td>Verbose<\/td><\/tr><tr><td><code>Log.d()<\/code><\/td><td>Debug<\/td><\/tr><tr><td><code>Log.i()<\/code><\/td><td>Info<\/td><\/tr><tr><td><code>Log.w()<\/code><\/td><td>Warn<\/td><\/tr><tr><td><code>Log.e()<\/code><\/td><td>Error<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u30bf\u30b0\uff08\u7b2c\u4e00\u5f15\u6570\uff09<\/strong> \u306f\u901a\u5e38\u3001\u30af\u30e9\u30b9\u540d\u3084\u753b\u9762\u540d\u3092\u5165\u308c\u307e\u3059\u3002\u30ed\u30b0\u691c\u7d22\u6642\u306b\u4fbf\u5229\u3067\u3059\u3002<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd0e \u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u9032\u3081\u65b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u2460 \u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306e\u78ba\u8a8d\u65b9\u6cd5<\/h3>\n\n\n\n<ol>\n<li>Logcat\u3067 <code>E<\/code>\uff08Error\uff09\u30ec\u30d9\u30eb\u3092\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0<\/li>\n\n\n\n<li><code>Exception<\/code> \u3084 <code>Caused by:<\/code> \u3092\u63a2\u3059<\/li>\n\n\n\n<li>\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u4e0a\u304b\u3089\u9806\u306b\u78ba\u8a8d<\/li>\n\n\n\n<li>\u81ea\u5206\u306e\u30a2\u30d7\u30ea\u306e\u30af\u30e9\u30b9\u540d\u3092\u542b\u3080\u884c\u3092\u63a2\u3059<\/li>\n<\/ol>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-scss\" data-lang=\"SCSS\" data-show-lang=\"0\"><code>E\/AndroidRuntime: FATAL EXCEPTION: main\nProcess: com.example.app, PID: 12345\njava.lang.NullPointerException: Attempt to invoke method on null object\n    at com.example.app.MainActivity.onCreate(MainActivity.java:42)<\/code><\/pre><\/div>\n\n\n\n<p><strong>\u3053\u3053\u3067\u6ce8\u76ee\u3059\u308b\u306e\u306f \u2192 <code>MainActivity.java:42<\/code><\/strong><br>\u2192 42\u884c\u76ee\u3067 <code>null<\/code> \u3092\u53c2\u7167\u3057\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2461 \u3088\u304f\u3042\u308b\u30c8\u30e9\u30d6\u30eb\u4f8b\u3068\u30ed\u30b0\u306e\u898b\u65b9<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u30c8\u30e9\u30d6\u30eb<\/th><th>\u5178\u578b\u30ed\u30b0\u4f8b<\/th><th>\u539f\u56e0\u3068\u5bfe\u7b56<\/th><\/tr><\/thead><tbody><tr><td><code>NullPointerException<\/code><\/td><td><code>Attempt to invoke...<\/code><\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3044<\/td><\/tr><tr><td><code>ActivityNotFoundException<\/code><\/td><td><code>Unable to find explicit activity class<\/code><\/td><td><code>AndroidManifest.xml<\/code> \u306b\u5b9a\u7fa9\u6f0f\u308c<\/td><\/tr><tr><td><code>NetworkOnMainThreadException<\/code><\/td><td><code>android.os.NetworkOnMainThreadException<\/code><\/td><td>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u3092UI\u30b9\u30ec\u30c3\u30c9\u3067\u884c\u3063\u3066\u3044\u308b<\/td><\/tr><tr><td><code>ClassCastException<\/code><\/td><td><code>java.lang.ClassCastException<\/code><\/td><td><code>findViewById()<\/code> \u306e\u30ad\u30e3\u30b9\u30c8\u30df\u30b9<\/td><\/tr><tr><td><code>Resources$NotFoundException<\/code><\/td><td><code>resource ID not found<\/code><\/td><td>\u5b58\u5728\u3057\u306a\u3044\u30ea\u30bd\u30fc\u30b9\u3092\u53c2\u7167\u3057\u3066\u3044\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf9b\ufe0f Logcat\u306e\u30d5\u30a3\u30eb\u30bf\u6d3b\u7528<\/h2>\n\n\n\n<p>Android Studio\u306eLogcat\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u30d5\u30a3\u30eb\u30bf\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul>\n<li><strong>\u30ed\u30b0\u30ec\u30d9\u30eb\u306e\u7d5e\u308a\u8fbc\u307f\uff08Debug\u3001Error\u306a\u3069\uff09<\/strong><\/li>\n\n\n\n<li><strong>\u7279\u5b9a\u30bf\u30b0\u306e\u307f\u8868\u793a<\/strong><\/li>\n\n\n\n<li><strong>\u7279\u5b9a\u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u691c\u7d22\uff08\u4f8b: &#8220;Exception&#8221;\uff09<\/strong><\/li>\n\n\n\n<li><strong>\u73fe\u5728\u5b9f\u884c\u4e2d\u306e\u30a2\u30d7\u30ea\u306e\u30ed\u30b0\u306e\u307f\u8868\u793a<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udc49 \u307e\u305a\u306f <code>\"Show only selected application\"<\/code> \u3092\u30aa\u30f3\u306b\u3057\u3066\u3001\u81ea\u5206\u306e\u30a2\u30d7\u30ea\u306e\u30ed\u30b0\u306b\u7d5e\u308b\u306e\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\uddf9 \u30c7\u30d0\u30c3\u30b0\u304c\u843d\u3061\u7740\u3044\u305f\u3089\u2026<\/h2>\n\n\n\n<p>\u30c7\u30d0\u30c3\u30b0\u6642\u306f <code>Log.d()<\/code> \u3092\u591a\u7528\u3057\u307e\u3059\u304c\u3001<strong>\u672c\u756a\u30d3\u30eb\u30c9\u3067\u306f\u3053\u308c\u3089\u3092\u51fa\u529b\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046<\/strong>\u3002<\/p>\n\n\n\n<p>Gradle\u306e\u30d3\u30eb\u30c9\u30bf\u30a4\u30d7\u3084 <code>BuildConfig.DEBUG<\/code> \u3092\u4f7f\u3063\u3066\u5236\u5fa1\u3067\u304d\u307e\u3059\uff1a<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-csharp\" data-lang=\"C#\" data-show-lang=\"0\"><code>if (BuildConfig.DEBUG) {\n    Log.d(&quot;DebugTag&quot;, &quot;\u3053\u3053\u306f\u958b\u767a\u4e2d\u3060\u3051\u51fa\u3059&quot;);\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \u307e\u3068\u3081<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u30dd\u30a4\u30f3\u30c8<\/th><\/tr><\/thead><tbody><tr><td>Logcat \u306f Android \u306e\u6a19\u6e96\u30ed\u30b0\u8868\u793a\u30c4\u30fc\u30eb<\/td><\/tr><tr><td>\u30ed\u30b0\u30ec\u30d9\u30eb\u306f V, D, I, W, E \u304c\u57fa\u672c<\/td><\/tr><tr><td><code>Log.d()<\/code> \u306a\u3069\u3067\u51fa\u529b\u3001\u30bf\u30b0\u540d\u3067\u6574\u7406\u3059\u308b<\/td><\/tr><tr><td>\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306f <code>E\/AndroidRuntime<\/code> \u3092\u63a2\u3059<\/td><\/tr><tr><td>Logcat \u30d5\u30a3\u30eb\u30bf\u3067\u52b9\u7387\u7684\u306b\u30c8\u30e9\u30d6\u30eb\u5bfe\u5fdc<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[54],"_links":{"self":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1375"}],"collection":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/comments?post=1375"}],"version-history":[{"count":2,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1375\/revisions"}],"predecessor-version":[{"id":1379,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/posts\/1375\/revisions\/1379"}],"wp:attachment":[{"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/media?parent=1375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/categories?post=1375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itstudy365.com\/blog\/wp-json\/wp\/v2\/tags?post=1375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}