0

I want to use JSQMessagesViewController as a dependency to my swift pod. When I build my example app I get the old non-modular header error related to the JSQSystemSoundPlayer but I don't know how to get around it with XCode 7.

Podspec:

s.dependency 'JSQSystemSoundPlayer'
s.dependency 'JSQMessagesViewController', '7.2.0' #Also tried 5.3.2

Errors:

enter image description here

enter image description here

Mihriban Minaz
  • 3,043
  • 2
  • 32
  • 52
Marc Nunes
  • 238
  • 3
  • 13
  • I have downloaded example app and it builds. Xcode version: 7.2.1. Also tried to use it as a dependency view Cocoa Pods "pod 'JSQSystemSoundPlayer'" still works. Did you change something in the project file? – Sasha Kozachuk Mar 10 '16 at 20:38
  • no I'm not consuming JSQMessagesViewController in any app. I meant my pod example app. I'm creating a pod and JSQMessagesViewController is a dependency – Marc Nunes Mar 10 '16 at 20:45

3 Answers3

2

This is a known issue with v7.2.0 of JSQMessagesViewController: https://github.com/jessesquires/JSQMessagesViewController/pull/1284

Check this pull-request: https://github.com/jessesquires/JSQMessagesViewController/pull/1284

Specifically, this comment from jessesquires (the author): https://github.com/jessesquires/JSQMessagesViewController/pull/1284#issuecomment-181132880

The fix will be part of v7.2.1 according to that thread.

pshah
  • 2,052
  • 1
  • 21
  • 40
1

It is not related to JSQSystemSoundPlayer. Add this at the beginning of your Podfile:

platform :ios, '8.0'
use_frameworks!

So app will use frameworks instead of static libraries for the included projects.

Summary of changes to JSQMessagesViewController:

  1. Change Podfile platform to iOS 8 (platform :ios, '8.0')
  2. Change Podfile to use frameworks instead of static libraries (use_frameworks!)
  3. Change project structure deployment target to iOS 8
  4. Run pod install
  5. Build & run the app
Mihriban Minaz
  • 3,043
  • 2
  • 32
  • 52
0

The issue is that Swift doesn't play nice with importing non-modular frameworks into frameworks. Essentially, you will only run into this problem when bundling a framework inside another. There is a simple solution, however it requires some work JSQSystemSoundPlayer as well as JSQMessagesViewController. Both projects will need to have the following Xcode project setting: DEFINES_MODULE = YES.

Marc Nunes
  • 238
  • 3
  • 13
  • inside JSQSystemSoundPlayer+JSQMessages.h change #import to @import JSQSystemSoundPlayer; This should fix the issue until v7.2.0 comes out as metioned by pshah below. – Marc Nunes Mar 14 '16 at 04:27