{"id":2730,"date":"2022-11-08T14:01:48","date_gmt":"2022-11-08T07:01:48","guid":{"rendered":"https:\/\/www.bagi2info.com\/?p=2730"},"modified":"2023-11-21T15:17:24","modified_gmt":"2023-11-21T08:17:24","slug":"masalah-dan-solusi-saat-development-di-macbook-pro-m2","status":"publish","type":"post","link":"https:\/\/www.bagi2info.com\/en\/problems-and-solutions-while-development-on-macbook-pro-m2\/","title":{"rendered":"Problems and Solutions While Development on MacBook Pro M2"},"content":{"rendered":"\r\n\r\nHello friends, while developing a mobile application using <strong>React Native<\/strong> the author was hampered by various setting problems on the <strong>Macbook Pro M2<\/strong>, here is a list of the problems noted and their solutions:\r\n\r\n\r\n\r\n\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.bagi2info.com\/en\/problems-and-solutions-while-development-on-macbook-pro-m2\/#Simulator_does_not_automatically_open\" >Simulator does not automatically open<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.bagi2info.com\/en\/problems-and-solutions-while-development-on-macbook-pro-m2\/#Git_Not_Logging_Lowercase_or_Uppercase_File_Name_Changes\" >Git Not Logging Lowercase or Uppercase File Name Changes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.bagi2info.com\/en\/problems-and-solutions-while-development-on-macbook-pro-m2\/#GADInvalidInitializationException\" >GADInvalidInitializationException<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.bagi2info.com\/en\/problems-and-solutions-while-development-on-macbook-pro-m2\/#How_to_Generate_Build_Dev_Client_in_Simulator\" >How to Generate Build Dev Client in Simulator<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Simulator_does_not_automatically_open\"><\/span>Simulator does not automatically open<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n\r\nWhen you want to run a mobile application developed using <strong>Expo<\/strong>, the command starts with <strong>expo start<\/strong> then presses the i button to activate the <strong>Simulator<\/strong>, and not a simulator that opens but is informed that <strong>Xcode<\/strong> must be installed via the <strong>App Store<\/strong>, even though Xcode has already been installed.\r\n\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><strong><em>Xcode needs to be installed (don\u2019t worry, you won\u2019t have to use it), would you like to continue to the App Store?<\/em><\/strong><\/blockquote>\r\n\r\n\r\n\r\n\r\nAfter searching through google, the solution is to simply type the command below:\r\n\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code class=\"language-bash\" lang=\"bash\">sudo xcode-select -s \/Applications\/Xcode.app<\/code><\/pre>\r\n\r\n\r\n\r\n\r\nPlease try again by typing expo start and try to open the simulator, the simulator will automatically open.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nReference:\r\n\r\n\r\n\r\n\r\n\r\nIssue with opening IOS Simulator on Expo Dev Tool\r\n\r\n\r\n\r\n\r\n\r\n<a title=\"\" href=\"https:\/\/developer.apple.com\/forums\/thread\/678469\">https:\/\/developer.apple.com\/forums\/thread\/678469<\/a>\r\n\r\n\r\n\r\n\r\n\r\n&nbsp;\r\n\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Git_Not_Logging_Lowercase_or_Uppercase_File_Name_Changes\"><\/span>Git Not Logging Lowercase or Uppercase File Name Changes<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n\r\nFile name changes using lowercase and uppercase letters will not be recorded by <strong>GIT<\/strong>, meaning that for example we have a physical file named <strong>test.js<\/strong> and submitted to github then after a while we want to change its name to <strong>Test.js<\/strong>, name changes like this will not be recorded by <strong>GIT<\/strong> .\r\n\r\n\r\n\r\n\r\n\r\nProblems will arise when we re-clone the repository and when we want to run the application there is a file error error.\r\n\r\n\r\n\r\n\r\n\r\nThe solution to this problem is to manually change the filename directly from the command prompt using the<strong> git mv<\/strong> command\r\n\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code class=\"language-bash\" lang=\"bash\">git mv test.js Test.js<\/code><\/pre>\r\n\r\n\r\n\r\n\r\nReference:\r\n\r\n\r\n\r\n\r\n\r\n<a title=\"\" href=\"https:\/\/stackoverflow.com\/questions\/17683458\/how-do-i-commit-case-sensitive-only-filename-changes-in-git\">https:\/\/stackoverflow.com\/questions\/17683458\/how-do-i-commit-case-sensitive-only-filename-changes-in-git\r\n<\/a>\r\n\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GADInvalidInitializationException\"><\/span>GADInvalidInitializationException<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n\r\nAfter successfully compiling the application for IOS and found no problems or warnings during build compile, the problem appears when running the application, the error message is:\r\n\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">GADInvalidInitializationException : Ads SDK was initialized without an application ID<\/blockquote>\r\n\r\n\r\n\r\n\r\nThe solution is to add Admob App ID in app.json, recompile it, once done, try to run app in simulator.\r\n\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\" title=\"app.json\"><code class=\"language-json line-numbers\" lang=\"json\">    \"ios\": {\r\n      \"supportsTablet\": true,\r\n      \"bundleIdentifier\": \"com.suryadi.personalnote\",\r\n      \"userInterfaceStyle\": \"automatic\",\r\n      \"buildNumber\": \"1.9.7\",\r\n      \"config\": {\r\n        \"googleMobileAdsAppId\": \"ca-app-pub-6894070964244250~8501322530\"\r\n      }\r\n    },<\/code><\/pre>\r\n\r\n\r\n\r\n\r\n&nbsp;\r\n\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Generate_Build_Dev_Client_in_Simulator\"><\/span>How to Generate Build Dev Client in Simulator<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n\r\nI use the Expo framework with the addition of expo-dev-client, for those who don&#8217;t know what expo-dev-client is, please read other articles <a href=\"https:\/\/www.bagi2info.com\/en\/get-to-know-react-react-native-bare-react-native-and-expo\/\">Getting to know React, React Native, Bare React Native, and Expo<\/a>\r\n\r\n\r\n\r\n\r\n\r\nHere is additional configuration to compile expo-dev-client specific in eas.json file\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code class=\"\">\r\n    \"developmentios\": {\r\n      \"developmentClient\": true,\r\n      \"distribution\": \"internal\",\r\n      \"ios\": { \"simulator\": true }\r\n    },\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\" title=\"eas.json\"><code class=\"language-json line-numbers\" lang=\"json\">{\r\n  \"cli\": {\r\n    \"version\": \"&gt;= 0.43.0\"\r\n  },\r\n  \"build\": {\r\n    \"development\": {\r\n      \"developmentClient\": true,\r\n      \"distribution\": \"internal\"\r\n    },\r\n    \"developmentios\": {\r\n      \"developmentClient\": true,\r\n      \"distribution\": \"internal\",\r\n      \"ios\": { \"simulator\": true }\r\n    },\r\n    \"preview\": {\r\n      \"distribution\": \"internal\"\r\n    },\r\n    \"production\": {}\r\n  },\r\n  \"submit\": {\r\n    \"production\": {}\r\n  }\r\n}\r\n<\/code><\/pre>\r\n\r\n\r\n\r\n\r\nReference:\r\n\r\n\r\n\r\n\r\n\r\n<a title=\"\" href=\"https:\/\/expo.canny.io\/feature-requests\/p\/custom-dev-clients-for-simulator\" target=\"_blank\" rel=\"noopener\">https:\/\/expo.canny.io\/feature-requests\/p\/custom-dev-clients-for-simulator <\/a>\r\n\r\n\r\n\r\n\r\n\r\neas build &#8211;profile preview\r\n\r\n","protected":false},"excerpt":{"rendered":"<p>Hello friends, while developing a mobile application using React Native the author was hampered by various setting problems on the Macbook Pro M2, here is a list of the problems noted and their solutions:&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2781,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[65,150],"class_list":["post-2730","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-komputer","tag-aplikasi-mobile","tag-react-native"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/posts\/2730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/comments?post=2730"}],"version-history":[{"count":10,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/posts\/2730\/revisions"}],"predecessor-version":[{"id":4572,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/posts\/2730\/revisions\/4572"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/media\/2781"}],"wp:attachment":[{"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/media?parent=2730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/categories?post=2730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bagi2info.com\/en\/wp-json\/wp\/v2\/tags?post=2730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}