75

Cannot run app. Failed to load Info.plist from bundle error occurs. When I CMD+K clean the project, it runs fine. But I have to clean the project every time I make changes and run the app.

enter image description here

Following is the screenshot of my podfile: enter image description here

Daniel Zhang
  • 5,778
  • 2
  • 23
  • 28
Chanchal Raj
  • 4,176
  • 4
  • 39
  • 46

22 Answers22

80

I had tried all suggestion and none of them work Then I tried to Reset content and Setting of simulator and it worked for me. :)

Reema
  • 1,200
  • 10
  • 10
  • 4
    FWIW this is not in the simulated phone itself, but in the Mac menu while you're running the Simulator app, up near the Apple in the upper left portion of your screen: Click "Simulator" then "Reset Content and Settings..." – Brooks Hanes May 03 '17 at 14:42
  • In addition to resetting the contents in simulator, also shutdown Xcode and clean the derived data folder. That worked for me. – ArdenDev May 13 '17 at 01:14
  • this happened to me when I changes the BundleID of the app. Resetting content did the trick. – nefarianblack Oct 05 '17 at 09:25
  • I try but it still doesn't resolve this issue. FYI, my build is based on React-Native. – anticafe Jan 16 '19 at 09:30
30

Simply

Just quit the simulator and open it again and it should works fine

Musa almatri
  • 5,596
  • 2
  • 34
  • 33
17

None of the above suggestions worked for me.

Changed the Embed setting for the complained framework to Do Not Embed resolved the issue. :)

Build Settings

Vittal Pai
  • 3,317
  • 25
  • 36
14

If you're still running into this issue after trying all the reset, checkout this answer to a similar question: https://stackoverflow.com/a/61846384/1341768

In your podfile replace:

use_frameworks! 

with :

use_frameworks! :linkage => :static
otusweb
  • 1,638
  • 1
  • 19
  • 30
9

1: Remove app from simulator,

2: Product > Clean ,

3: Simulator > Hardware > Reboot ,

It solved my problem. In case it doesn't resolved, change your bundle identifier.

Ashish Gupta
  • 737
  • 11
  • 18
8

It was duplicated frameword when you config. Please check again in Embedded Binaries and Linked Frameworks and Libraries. With some frameworks, you don't need add in both sections, please remove one. It worked with me

6

This error occurs due to 'RealmSwift'. When you try to write in realm in certain directory, this error occurs, due to the conflicts in overwriting with realm.

You may want to Reset Content & Settings in simulator and also try cleaning your build folder in Xcode using Cmd+Shift+Option+K

Aashish
  • 2,532
  • 2
  • 23
  • 28
  • I did already mention in the question that I am already cleaning the project and it solves the problem temporarily i.e. I need to do it every time and it's not a permanent solution. Even trying reset the content and settings of the simulator solves the problem temporally. – Chanchal Raj May 25 '17 at 08:59
  • Well, this error occurs due to 'RealmSwift'. When you try to write in realm in certain directory, this error occurs, due to the conflicts in overwriting in realm. – Aashish May 25 '17 at 09:16
4

I had this problem when integrating Firebase to my project. The issue was that Xcode automatically configured project to "Embed&Sign" the libraries when I drag&drop them into "Framworks, Libraries, and Embedded Content" section.

To fix that, I manually set them to "Do Not Embed".

kubilay
  • 5,047
  • 7
  • 48
  • 66
2

I encountered this error in one of my projects and narrowed down a set of exact conditions that are able to reproduce it, thereby preventing installation to the simulator.

With Xcode 10.2.1, I was testing linking a framework. I noticed in the project navigator panel that two instances of it were present. This could have been due to my multiple attempts.

Inside the Xcode project package, I opened the file MyProject.xcodeproj/project.pbxproj and confirmed that the two instances were identical. The following snippet shows an example of how this was represented.

/* Begin PBXFileReference section */
...
    65C8CE8522CA0D3500271FFD /* MyFrameworkForiOS.framework */ = { 
        isa = PBXFileReference; 
        lastKnownFileType = wrapper.framework; 
        name = MyFrameworkForiOS.framework; 
        path = "../my-frameworks/out/MyFrameworkForiOS.framework"; sourceTree = "<group>"; 
    };
    65C8CE8722CA0D3800271FFD /* MyFrameworkForiOS.framework */ = {
        isa = PBXFileReference; 
        lastKnownFileType = wrapper.framework; 
        name = MyFrameworkForiOS.framework; 
        path = "../my-frameworks/out/MyFrameworkForiOS.framework"; sourceTree = "<group>"; 
    };
...
/* End PBXFileReference section */

By removing a duplicate reference in the project navigator (with command-backspace), I was able to install my app to the simulator without the error.

What didn't matter was the contents of Info.plist in my framework as it only had an empty root dictionary. Therefore, the error message may be misleading relative to the actual cause.

Daniel Zhang
  • 5,778
  • 2
  • 23
  • 28
1

It is annoying. Temporary I remove app on simulator then rebuild project work but still waiting for a better solution This problem likely to a problem with core data i have meet in the past.

Update: this solution work for me: https://stackoverflow.com/a/24042126/5387768

Community
  • 1
  • 1
Suke
  • 138
  • 1
  • 8
1

Remove the app from the Simulator worked well.

Pau Ballada
  • 1,491
  • 14
  • 13
1

Search for "Erase all content and settings" in help for emulator

Amit Patel
  • 1,795
  • 16
  • 20
1

swift 4,5

i had same problem, after some analysis i just found that i removed one of framework that cause this error. adding framework again solved t for me.

1

Issue: Same issue came on Xcode-11 and none of the above methods worked.

Answer You need to check first the issue, where it is coming from. In my case it was due to all Pod libraries info.plist file was missing. (God knows how it got missed).

  1. Comment the "pod libraries" in "pod file" and run "pod install"
  2. Uncomment the "pod libraries" in "pod file" and run "pod install" again.

and it worked.

Ankit
  • 638
  • 1
  • 8
  • 10
1

Have run into this a couple of times in iOS w/ React Native. Found that a couple of extra steps helped. What ultimately fixed was:

1: Erase all contents and settings from simulator

2: Delete node modules

3: Delete pods folder

4: Reinstall node modules

5: Reinstall pods

6: Delete top secret derived data folder for Xcode

7: Xcode -> Product -> Clean build folder

8: Close out of metro bundler

9: (optional) Buy a new Mac Book Pro

10: Run Xcode

11: Contemplate the 30 minutes you're never going to get back

Alistair Cooper
  • 251
  • 1
  • 3
  • 11
0

If resetting the Simulator did't work. Try to change simulator like from iPhone6 to iPhone5s. Then later run in iPhone6 simulator and reset the Simulator again. It will start working.

Muzammil
  • 1,529
  • 1
  • 15
  • 24
0

After trying all of the above perfectly acceptable solutions (some of which had worked for me in the past) I was running out of ideas to solve this issue - finally resorting to rebooting my MacBook which magically resolved the issue.

Sometimes...

Neil Palethorpe
  • 359
  • 4
  • 6
0

Following the below steps solved the issue for me:

  • Update the cocoapods by brew upgrade cocoapods
  • Clean the build folder using cmd+shift+k
  • Delete the derived data folder using cmd+shift+alt+k
  • Erase content and setting of simulator
  • Remove the pods completely and reinstall by rm -rf Pods\ Podfile.lock && pod install
  • run the project by Xcode and the app installed successfully
0
  1. Remove Pods and
  2. Install Pods again

is also one solution.

The reinstallation of Pods worked for me.

RajaSekhar
  • 11
  • 1
0

I tried many options like clean build, delete derived data, erase all content and settings in the simulator, etc. But still the issue exists.

At last, I restarted the machine then I can run the app perfectly.

IKKA
  • 6,297
  • 7
  • 50
  • 88
0

use this command in terminal : defaults delete com.apple.dt.Xcode

then delete derived folder of Xcode

finally delete node modules and pods

reinstall node modules and pods while Xcode is closed

then start you project as normal.

0

if none of the above solution works for you then you should reset xcode to default

steps:

  1. defaults delete com.apple.dt.Xcode
  2. defaults delete -app xcode
  3. rm -rf $HOME/Library/Application\ Support/Developer/Shared/Xcode
  4. rm -rf $HOME/Library/Saved\ Application
    State/com.apple.dt.Xcode.savedState
  5. rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
  6. Restart macbook
  7. Delete node_modules and pod folder
  8. delete /Users/{YourUser}/Library/Developer/Xcode/DerivedData ( hint: click pref -> locations -> click arrow next to Drived DAta)
  9. close xcode
  10. install node_modules and pods
  11. run project like normal.