Swift - Unable to open file in target Xcode 10

前端 未结 15 880
独厮守ぢ
独厮守ぢ 2020-12-30 23:06

I am trying to run Aplication which I have downloaded from GitHub.

When I run get error unable to open file in target, I have Xcode 10.

I already searched f

相关标签:
15条回答
  • 2020-12-30 23:17

    1- in xcode menu --> project --> clean build files

    2- close project

    3- in terminal cd

    4- in terminal pod update

    5- re-open project..xcworkspace file

    6- clean, build

    good luck

    0 讨论(0)
  • 2020-12-30 23:18

    I was facing the same error opening an old project in a new macbook with a recent installation of Xcode and no cocoa pods or anything related on it.

    My way to fix this was following some of the steps en the issues #1727 of alamofire and change some things. Open the terminal and cd project where the pod file is.

    So, this is what worked for me:

    • sudo gem install cocoa pods
    • pod repo remove master
    • pod setup
    • pod repo update
    • pod install

    Then just, clean build folder and build the project.

    0 讨论(0)
  • 2020-12-30 23:18

    Run following commands after you have downloaded Xcode project from GitHub:

    cd /your-xcode-project
    pod install
    

    This worked on Xcode 10.2.

    0 讨论(0)
  • 2020-12-30 23:19

    I had this issue too with project I cloned from GitLab. Your error looks extremely similar to mine. I solved it by running this in Terminal:

    cd path/to/your/project
    pod install
    

    When I checked project folder in Finder, there was a Podfile. But same project viewed in Xcode had nothing under 'Pods' module. From this I figured out the pods are not installed (or installed properly?) and installing them solved this error.

    If there is some Pods or .xcworkspace file, it might be worth doing pod deintegrate before installation - just to be sure :)

    0 讨论(0)
  • 2020-12-30 23:20

    This happened due to change the Project Name or Miss the Pods from Your Project

    if the Pods are Miss Then Following Method

    1. open the Project and Command + Shift + K
    2. Close the Project
    3. Open Terminal got to Your Xcode Project Directory cd /your-Xcode-project
    4. if coca pods already installed so skip this Point if not sudo gem install cocoa pods run this Command on terminal
    5. pod install

    If Above Method not Working so its Project name Issue then Go with following Method

    1. First, open your Pod File and change the target
    2. target 'your Xcode project name' do

    run the Following Commands from Terminal

    go to Your directory from terminal

    pod deintegrate

    pod clean

    pod install

    Done now open your xcWorkSpace file

    0 讨论(0)
  • 2020-12-30 23:27

    Just stumbled into the issue recently myself. It seems it's a bug in CocoaPods.

    Possible fix: gem install cocoapods --pre

    0 讨论(0)
提交回复
热议问题