Swift – Unable to open file in target Xcode 10

A solution I found to work for me was

Inside the project root directory

root
  |- <ProjectName>
  |- <ProjectName>.xcodeproj
  |- <ProjectName>.xcworkspace
  |- <ProjectName>Tests
  |- Podfile
  |- Podfile.lock
  |- Pods

Delete the following files. Ensure you have copied the contents of Podfile.

  1. Podfile
  2. Podfile.lock
  3. Pods Folder

Open your .xcodeproj using Xcode or using terminal command

open <ProjectName>.xcodeproj

Inside Xcode, locate the “Pods” folder which should contain something along the lines of…

Pods
|- Pods-<ProjectName>.debug.xconfig
|- Pods-<ProjectName>.release.xconfig

Delete those references and select “move to trash” when prompted.

Close Xcode

Now run the following:

pod init && pod install

Open your Podfile and paste in your previously copied old Podfile that was deleted earlier.

run the following command:

pod install

In terminal open Xcode again with the following command

open <ProjectName>.xcworkspace

Note: that I opened the xcworkspace file NOT the xcodeproj file.

At this point for me I was able to compile my code as normal without having to change back to the Legacy Build System.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)