Search code examples
iosswiftxcodejsqmessagesviewcontroller

Can't use module I just install using cocoaPods (Swift)


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'

Solution

  • 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