26

I was having issues with my Bridge.h imports finding their intended targets after a cocoapods install and run.

I had:

#import <TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import <DateTools/DateTools.h>

But it didnt work because my Headers folder was empty, so I copied those two folder into the Headers folder and hardcoded the path:

#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/DateTools/DateTools.h>

This worked and the app built but when I ran it it gave this error: The operation couldn’t be completed. (LaunchServicesError error 0.)

Here is the console output:

6/2/16 4:41:24.961 PM uploadDSYM[3519]: Fabric.framework/run 1.4.0
6/2/16 4:41:24.981 PM uploadDSYM[3521]: Fabric.framework/run 1.4.0
6/2/16 4:41:25.011 PM appleeventsd[51]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.019 PM sharedfilelistd[251]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.093 PM Fabric[257]: Bundle indentifier is of type (null), returning empty string.
6/2/16 4:41:25.752 PM com.apple.CoreSimulator.CoreSimulatorService[331]: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=MissingBundleIdentifier, ErrorDescription=Bundle at path /Users/username/Library/Developer/CoreSimulator/Devices/#####-####-####-####-##########/data/Library/Caches/com.apple.mobile.installd.staging/temp.16rUWf/extracted/AppName.app/Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its Info.plist}

The initiall error that I have looks alot like this stuff: Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0) I tried all the clean builds and the reboots suggested but none worked. Also all the sharekit solutions also did not work because I do not have sharekit.

EDIT 1

My guess is this: Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its Info.plist} is the real problem and I need to change my info.plist file to find TPKeyboardAvoiding

EDIT 2

My info.plist:

enter image description here

EDIT 3

This question is a problem that arose after I tried to workaround the problem which I ran into before which is described in this question: Empty Pod Headers Folder after `pod install`

Community
  • 1
  • 1
Rorschach
  • 3,684
  • 7
  • 33
  • 77
  • I've been strugling with similar issue. Take a look at answer on similar question: [Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0)](http://stackoverflow.com/a/39049990/923642) – JakubKnejzlik Aug 20 '16 at 02:50
  • I was able to solve this with this answer: http://stackoverflow.com/a/39049990/4564088 but I think my problem wasn't 100 % identical. – Aleksi Sjöberg Oct 24 '16 at 07:53

5 Answers5

78

For me cleaning the build folder worked. In Xcode, hold alt Product -> Clean Build Folder..

Let me know if it works for you!

Ruud Visser
  • 3,381
  • 2
  • 20
  • 19
  • 1
    Worked for me! Wonder what that primary difference is between cleaning the build folder and just cleaning the project... google might know. – justColbs Nov 06 '16 at 05:41
  • Thank you for the answer, it was the solution for me. I'd like to invite you as @justColbs mentioned to describe what's the difference between the default clean and the cleaning the build folder. – Ahmad F May 04 '17 at 06:19
  • @justColbs [here](http://stackoverflow.com/questions/8087065/xcode-4-clean-vs-clean-build-folder) is what are we looking for :) – Ahmad F May 04 '17 at 06:35
  • Worked 4 me! Thanks a lot. – OmniBug May 08 '17 at 02:10
17

I had to close xcode and delete derived data. Just delete this folder

rm -rf ~/Library/Developer/Xcode/DerivedData/

None of these approaches worked for me

  1. gem uninstall cocoapods, gem install cocoapods and pod install
  2. pod install
  3. clean xcode using cmd+k
hfossli
  • 22,616
  • 10
  • 116
  • 130
2

This is the strange behaviour of Xcode.

FIXED SOLUTION:

0- Simulator: Simulator > Reset Content & Settings

1- Hold alt Product -> Clean Build Folder

2- Close Xcode

3- Go to project directory using terminal cd ~/projectDir

4- Run pod install

5- Open project in Xcode

6- Run the project.

MANISH PATHAK
  • 2,602
  • 4
  • 27
  • 31
0
$ gem uninstall cocoapods
$ gem install cocoapods

Add all things (crashlytics and fabric included) as pods. Delete any extra things you made i.e. /Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h

$ pod install
Rorschach
  • 3,684
  • 7
  • 33
  • 77
0

we have two options to resolve the issue

  1. Delete the derived data from xcode's default location as specified in File -> Workspace Settings

  2. Change the derived data location to a custom location in File -> Workspace Settings