0

I was working on my app, and when I ran it, that thing appears weirdly:

(I wanted to link images, but I don't already have 10 of reputation...)

"#import < MapKit/MapKit.h >    Could not build module 'MapKit'"

Before, I didn't had that problem (I precise that I linked correctly the framework and added it to my Frameworks folder), and it appears directly a few minutes ago. Does anyone could give me some help ?

Paul R
  • 208,748
  • 37
  • 389
  • 560
Lkm
  • 113
  • 11
  • 1
    Quit Xcode and clean out the derived data folder: http://stackoverflow.com/questions/5714372/how-to-empty-caches-and-clean-all-targets-xcode-4/6247073#6247073 – matt Dec 27 '14 at 19:30
  • Thank you a lot for the tip ! It seems to be fixed, It runs, but I don't understand: The issue indicator is always present at the line of the "Include" but not in the top bar (I precise that I closed Xcode, I deleted all derived data, and I removed settings of the Simulator) Edit: When I write for example : self.mapView, the autocompletion not recognize the object like a MKMapView class but like an integer (* int) – Lkm Dec 27 '14 at 20:04
  • Okay, I have a new idea. I think you may have done the wrong thing with the framework. Look inside your project folder and see if, at any depth, you have accidentally added the MapKit framework _itself_ to your code! If so, delete it; that's the source of the problem. The MapKit framework already exists, so you don't need a second copy. – matt Dec 27 '14 at 20:10
  • I did all you had suggested, but the problem is always the same: I have my "Frameworks" folder in the Project's folder, but I checked that the framework was not existing in double, but not... For all the other Frameworks, that's good, but this is only with the MapKit framework that is happening... – Lkm Dec 27 '14 at 20:37
  • Sorry, do you _literally_ have a folder inside the Project folder called "Frameworks"? You shouldn't have that, should you? – matt Dec 27 '14 at 20:45
  • That should be more simple with linked images... Yes, I have, with MapKit.Framework and other Frameworks and Libraries inside, this is why I do not understand... Finally that's for all ViewControllers, and for all Frameworks included, I tried to write other frameworks following the line of the MapKit header, It worked. After I cut/paste the MapKit Header's line behind another "#import" Framework directive line, and the problem happens not for MapKit Framework in particular, but for all frameworks, compared with few days ago, I did not change anything and all worked well... – Lkm Dec 27 '14 at 23:20
  • I finally found a magically solution, I set the derived data to "relative in Xcode preferences ! But thank you so much for your help ! :-) – Lkm Dec 28 '14 at 00:07

2 Answers2

1

change In target setting the "Allow Non-modular Includes in Framework modules" setting to YES

Mohit Tomar
  • 5,173
  • 2
  • 33
  • 40
0

I think you need to go the app -- General -- Linked Frameworks and Libraries to add the MapKit.framework first.