0

I'm trying to use JSQMessagesViewController library but I can't seem to install it correctly... I can't import JSQMessagesViewController because Xcode tells me it doesn't exist.

I installed it using cocoa pods, the same way I installed Firebase and GoogleMaps... I can import and use those two, but it just doesn't work, somehow, with JSQMessages.

Any one has an idea why?

The error says "No such module 'JSQMessagesViewController'"

So I got it fixed. If anyone want my pod file, it is the following:

     source 'https://github.com/CocoaPods/Specs.git'
     platform :ios, '8.0'
     use_frameworks!
     target 'MyProject'
     pod 'GoogleMaps'
     pod 'Firebase'
     pod 'JSQMessagesViewController'

2 Answers2

0

In order to use CocoaPods written in Swift, you must explicitly include use_frameworks! to opt into using frameworks. If you forget to include this, and CocoaPods detects you’re trying to use a Swift CocoaPod,

for ex :

platform :ios, "9.0"
use_frameworks!

pod 'JSQMessagesViewController'

for more information see this tutorial

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
-1

You have tagged this with Swift, so you probably haven't imported the framework in the bridging header file. The framework is in Objective-C, so you have to import it through the bridging header file. Try that, and see if you can make it work.

#import "JSQMessagesViewController.h"
#import "JSQMessage.h"
#import "JSQMessageBubbleImageDataSource.h"
#import "JSQMessageAvatarImageDataSource.h"
#import "JSQMessagesBubbleImage.h"
#import "JSQMessagesBubbleImageFactory.h"
#import "UIColor+JSQMessages.h"
#import "JSQMessagesAvatarImageFactory.h"
#import "JSQSystemSoundPlayer.h"
#import "JSQSystemSoundPlayer+JSQMessages.h"
#import "JSQMessagesTimestampFormatter.h"
#import "JSQPhotoMediaItem.h"

I didn't use cocoa pods when I used it in my project, but I still have to use the bridging header file.

Ivan C Myrvold
  • 680
  • 7
  • 23