4

I am working with xcode 6.3, swift 1.2 and I install the "JSQMessagesViewController" library with cocoapods. Here is my pod file:

pod 'JSQMessagesViewController'

and my bridge file:

#import <JSQMessagesViewController/JSQMessages.h>

then I get the error:

'JSQMessagesViewController/JSQMessages.h' file not found with <angled> include; use "quotes" instead

I don't know why it goes wrong. When I update the bridge file with

 #import "JSQMessagesViewController/JSQMessages.h"

I get the error

JSQMessagesViewController/JSQSystemSoundPlayer+JSQMessages.h:19:9: 'JSQSystemSoundPlayer/JSQSystemSoundPlayer.h' file not found with <angled> include; use "quotes" instead

This really gets me confused because the error is in the source code of JSQMessagesViewController which I cannot modify. I have googled for one day and get no methods to fix it. Since the JSQMessagesViewController library is so popular in githup, I believe the there must be someone know how to fix it.

MGY
  • 7,245
  • 5
  • 41
  • 74
jerry_sjtu
  • 5,216
  • 8
  • 29
  • 42

4 Answers4

5

You used the notation for a framework. Are you using cocoapods 0.36 or later? Then you could make a framework from JSQMessagesViewController by putting this in your pod file:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'JSQMessagesViewController'
Edwin Vermeer
  • 13,017
  • 2
  • 34
  • 58
4

I ran into this issue and I was using Xcode7, swift 2, iOS 9, using cocoapods version 0.38.2 and what solved it for me was removing the declaration of #import <JSQMessagesViewController/JSQMessages.h> from the Bridging-Header.h file.

Then import it to the class you want to use it in.

 import UIKit
 import JSQMessagesViewController

 class MessageViewController: JSQMessagesViewController {

 }

As of Cocoapods 0.36 if you put use use_frameworks! into the Podfile (like Eric D said, then cocoapods will create a framework of any Pod that you include.

bolnad
  • 4,533
  • 3
  • 29
  • 41
3

This should work:

#import "JSQMessages.h"
#import "JSQMessageData.h"

Example taken from this Swift repo.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
  • I still get the error:/Pods/Headers/Private/JSQMessagesViewController/JSQSystemSoundPlayer+JSQMessages.h:19:9: 'JSQSystemSoundPlayer/JSQSystemSoundPlayer.h' file not found with include; use "quotes" instead – jerry_sjtu Apr 17 '15 at 09:49
  • Did you also install the [sound player](https://github.com/firebase/ios-swift-chat-example/tree/master/JSQSystemSoundPlayer) with CocoaPods? Looks like it's missing from your install. – Eric Aya Apr 17 '15 at 09:53
  • Or maybe the import syntax has to change too, like the other ones: `#import "JSQSystemSoundPlayer.h"` – Eric Aya Apr 17 '15 at 09:59
  • CocoaPods installs the JSQSystemSoundPlayer automatically. Add #import "JSQSystemSoundPlayer.h" don't fix the problem. @ericd – jerry_sjtu Apr 18 '15 at 02:14
-1

For me it worked using this Podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod 'JSQMessagesViewController'

And creating the bridge header.

(iOS 9, xCode 7, cocoapods 0.39.0)

Andre Simon
  • 665
  • 10
  • 16