title: Build is failing for older projects for React-Native iOS XCode Version 12.5
body: <p>It is very new to me see this problem which started happening recently. Previously my app used to work fine on the iOS simulator by running this command <code>react-native run-ios</code>. Now I have done a lot of research and made my app run via XCode. But somehow the metro bundler is not linked when the app runs via XCode.</p>
  <p>I tried running the app via <code>react-native run-ios</code> and every time I am seeing this error. It is too big to copy paste every error here, but here are some of them:</p>
  <pre><code>Undefined symbols for architecture x86_64:
    &quot;Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer&lt;A&gt;) -&gt; (Swift.IndexingIterator&lt;Swift._ArrayBuffer&lt;A&gt;&gt;, Swift.Int)&quot;, referenced from:
        generic specialization &lt;serialized, Swift._ArrayBuffer&lt;Swift.Int8&gt;&gt; of Swift._copyCollectionToContiguousArray&lt;A where A: Swift.Collection&gt;(A) -&gt; Swift.ContiguousArray&lt;A.Element&gt; in libMixpanel-swift.a(AutomaticProperties.o)
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
  
  ** BUILD FAILED **
  
  
  The following build commands failed:
          Ld /Users/careerlabsdev/Library/Developer/Xcode/DerivedData/CareerLabs_Elev8-gxcfanteiuxazegkgwkjkrjxbdmw/Build/Products/Debug-iphonesimulator/CareerLabs.app/CareerLabs normal
  (1 failure)
  </code></pre>
  <p>I have done a lot of things to make it to work. The only success I got here is, <code>while running the command react-native run-ios, it opens up the metro bundler server</code>. After that it fails with giving a 1000 lines of error. I picked the error which had some cream part. Some key words to pick from the error:</p>
  <ul>
  <li>ld: symbol(s) not found for architecture x86_64</li>
  <li>clang: error: linker command failed with exit code 1 (use -v to see invocation)</li>
  <li>Did not understand the word <strong>Ld</strong>, which is listed under BUILD FAILED</li>
  </ul>
  <p>What I did is as follows:</p>
  <ol>
  <li>Deleting node_modules, Pods. Cleaning the build from XCode. Running <code>npm install</code> and then <code>cd ios &amp;&amp; pod install</code> and then ran the command <code>react-native run-ios</code></li>
  <li>Deleting Pods, Podfile.lock. Did <code>pod install</code> and then in the root <code>react-native run-ios</code></li>
  <li>Doing these:</li>
  </ol>
  <pre><code>rm -rf ~/Library/Caches/CocoaPods
  rm -rf Pods
  rm -rf ~/Library/Developer/Xcode/DerivedData/*
  pod deintegrate
  pod setup
  pod install
  cd ..
  react-native run-ios
  </code></pre>
  <ol start="4">
  <li>Restarted the system, and ran the command again <code>react-native run-ios</code></li>
  <li>Added <strong>arm64</strong> in the <strong>Excluded Architecture</strong> from XCode. Please note, this enabled me to  <code>build and run</code> the app <strong>successfully</strong> on XCode. But it doesn't get attached to the metro bundler server. Looks like it runs the <strong>release mode</strong> only.</li>
  <li>Updated my package <code>react-native-gesture-handler</code> to the latest one which is <strong>1.10.3</strong>, to see if that removes my problem. But no luck.</li>
  </ol>
  <p>My <strong>Podfile</strong> look like this:</p>
  <pre class="lang-swift prettyprint-override"><code>  platform :ios, '10.0'
  
    use_flipper!({'Flipper' =&gt; '0.81.0'})
    post_install do |installer|
      flipper_post_install(installer)
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
        end
      end
    end
  </code></pre>
  <p>I am out of options now, and waiting for some insight to be given. It is indeed frustrating to see an error on something which never created a problem. I am using Apple M1 Chip Macbook.</p>
  <p><strong>Update V1.0</strong></p>
  <ul>
  <li>I have tried commenting down the <code>use_flipper!()</code>, from the <code>/ios/Podfile</code>, and then redid the same things, like removing <code>Pods</code>, <code>Podfile.lock</code>. Running this command, <code>pod update &amp;&amp; pod install &amp;&amp; cd.. &amp;&amp; npm run ios</code>. Ran into multiple issues. I don't know what the issue is with XCode and React Native on Apple M1.</li>
  </ul>
  <p><strong>Update V2.0</strong></p>
  <p>I have found some significant places where the developers are complaining about the same. <strong>XCode has forced updated my version to 12.5, without my notice</strong>. And now XCode is creating a problem with RN Older projects. Here are the supportive links for the same:</p>
  <ul>
  <li><a href="https://github.com/facebook/folly/issues/1527#issuecomment-788526038" rel="nofollow noreferrer">Flipper doesn't build with XCode 12.5 (GitHub)</a></li>
  <li><a href="https://www.reddit.com/r/reactnative/comments/n0vb7b/do_i_need_flipper/" rel="nofollow noreferrer">Do I need Flipper? (Reddit)</a></li>
  </ul>
  <p>I hope this may give some insight to the developers who are confused like me. Please take a look, and looks like <code>Facebook</code> is fixing it, but don't know when. Have to keep an eye on it :/</p>