{"id":1961,"date":"2017-10-09T13:09:00","date_gmt":"2017-10-09T07:39:00","guid":{"rendered":"http:\/\/ramkulkarni.com\/blog\/?p=1961"},"modified":"2017-10-09T13:10:50","modified_gmt":"2017-10-09T07:40:50","slug":"fixing-cfbundleidentifier-does-not-exist-error-in-react-native-ios-build","status":"publish","type":"post","link":"http:\/\/ramkulkarni.com\/blog\/fixing-cfbundleidentifier-does-not-exist-error-in-react-native-ios-build\/","title":{"rendered":"Fixing &#8220;:CFBundleIdentifier, Does Not Exist&#8221; Error in React Native iOS build"},"content":{"rendered":"<p>After spending a couple of hours trying to debug this issue, I thought I would write about the solution that worked for me. Here are some of the possible solutions I found on the web &#8211;<\/p>\n<ol>\n<li>Make sure 8081 port is free and not taken by any application. On Mac you can check this by running command <code>lsof -i :8081<\/code>. If any process is running then kill it &#8211; <code>kill -9 &lt;pid&gt;<br \/>\n<\/code><\/li>\n<li>Remove spaces from the folder path of the project<\/li>\n<li>Run <code>react-native upgrade<\/code> in the project folder<\/li>\n<\/ol>\n<p>In my case the problem was #1. However simple <code>lsof<\/code> command did not show any process. But <code>sudo lsof -i :8081<\/code>did show the process. It turned out that McAfee agent was running on the same port. Killing the agent is not an option for me. So the next thing to do was find a way to change the port of Ract-Native packager.<\/p>\n<p>Following steps worked for me &#8211;<\/p>\n<ol>\n<li>Opne\u00a0node_modules\/react-native\/local-cli\/server\/server.js and change port 8081 to the port you want to run the packager on. In the version of React-Native I am using, it is in the following code &#8211;\n<pre style=\"color: #000000; background: #ffffff;\">module<span style=\"color: #808030;\">.<\/span>exports <span style=\"color: #808030;\">=<\/span> <span style=\"color: #800080;\">{<\/span>\r\n  name<span style=\"color: #800080;\">:<\/span> <span style=\"color: #800000;\">'<\/span><span style=\"color: #0000e6;\">start<\/span><span style=\"color: #800000;\">'<\/span><span style=\"color: #808030;\">,<\/span>\r\n  func<span style=\"color: #800080;\">:<\/span> server<span style=\"color: #808030;\">,<\/span>\r\n  description<span style=\"color: #800080;\">:<\/span> <span style=\"color: #800000;\">'<\/span><span style=\"color: #0000e6;\">starts the webserver<\/span><span style=\"color: #800000;\">'<\/span><span style=\"color: #808030;\">,<\/span>\r\n  options<span style=\"color: #800080;\">:<\/span> <span style=\"color: #808030;\">[<\/span><span style=\"color: #800080;\">{<\/span>\r\n    command<span style=\"color: #800080;\">:<\/span> <span style=\"color: #800000;\">'<\/span><span style=\"color: #0000e6;\">--port [number]<\/span><span style=\"color: #800000;\">'<\/span><span style=\"color: #808030;\">,<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">default<\/span><span style=\"color: #800080;\">:<\/span> <span style=\"color: #008c00;\">8090<\/span><span style=\"color: #808030;\">,<\/span>\r\n    <span style=\"color: #800000; font-weight: bold;\">parse<\/span><span style=\"color: #800080;\">:<\/span> <span style=\"color: #808030;\">(<\/span>val<span style=\"color: #800080;\">:<\/span> string<span style=\"color: #808030;\">)<\/span> <span style=\"color: #808030;\">=<\/span><span style=\"color: #808030;\">&gt;<\/span> <span style=\"color: #797997;\">Number<\/span><span style=\"color: #808030;\">(<\/span>val<span style=\"color: #808030;\">)<\/span><span style=\"color: #808030;\">,<\/span>\r\n  <span style=\"color: #800080;\">}<\/span><span style=\"color: #808030;\">,<\/span>\r\n<\/pre>\n<\/li>\n<li>Change references to port 8081 in following files &#8211;\n<ol>\n<li>node_modules\/react-native\/Libraries\/Core\/Devtools\/getDevServer.js<\/li>\n<li><span class=\"s1\">node_modules\/react-native\/React\/React.xcodeproj<\/span><\/li>\n<li><span class=\"s1\">node_modules\/react-native\/React\/ReactLegacy.xcodeproj<\/span><\/li>\n<li><span style=\"font-size: 1rem;\">node_modules\/react-native\/React\/Base\/RCTBundleURLProvider.m<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>If above changes do not fix the problem, you may want to try replacing all references to port 8081 in the files in node_modules\/react-native folder.<\/p>\n<p>Wish Facebook makes changing packaging port easier than the above process.<\/p>\n<p>-Ram Kulkarni<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After spending a couple of hours trying to debug this issue, I thought I would write about the solution that worked for me. Here are some of the possible solutions I found on the web &#8211; Make sure 8081 port is free and not taken by any application. On Mac you can check this by &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/ramkulkarni.com\/blog\/fixing-cfbundleidentifier-does-not-exist-error-in-react-native-ios-build\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing &#8220;:CFBundleIdentifier, Does Not Exist&#8221; Error in React Native iOS build&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[78,144],"tags":[14,145],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2g9O8-vD","jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts\/1961"}],"collection":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/comments?post=1961"}],"version-history":[{"count":3,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts\/1961\/revisions"}],"predecessor-version":[{"id":1964,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/posts\/1961\/revisions\/1964"}],"wp:attachment":[{"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/media?parent=1961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/categories?post=1961"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ramkulkarni.com\/blog\/wp-json\/wp\/v2\/tags?post=1961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}