ChatSecure-iOS icon indicating copy to clipboard operation
ChatSecure-iOS copied to clipboard

Can't compile (JSQSystemSoundPlayer playSoundWithName:extension not declared)

Open roelvanhoof opened this issue 12 years ago • 25 comments

After successfully following the installation instructions I am getting the error below. The installation worked as expected, gitmodules downloaded, pods installed, build-all scripts ran, opened the .xcworkspace.

There was one thing I didn't do but I don't know if this problem is related to that, which is 'add the public signing keys for OpenSSL, GnuPG, libevent, and libotr', i just downloaded and installed the GPGTools.

The error I am getting is this, it happens halfway through the compile in xcode.

/Projects/ChatSecure-iOS/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.m:29:42: No visible @interface for 'JSQSystemSoundPlayer' declares the selector 'playSoundWithName:extension:'

When I look in xcode at the pods that are installed I do see the JSQSystemSoundPlayer pod.

roelvanhoof avatar Oct 14 '14 08:10 roelvanhoof

Are you still experiencing this issue?

On Tue, Oct 14, 2014 at 1:26 AM, roelvanhoof [email protected] wrote:

After successfully following the installation instructions I am getting the error below. The installation worked as expected, gitmodules downloaded, pods installed, build-all scripts ran, opened the .xcworkspace.

There was one thing I didn't do but I don't know if this problem is related to that, which is 'add the public signing keys for OpenSSL, GnuPG, libevent, and libotr', i just downloaded and installed the GPGTools.

The error I am getting is this, it happens halfway through the compile in xcode.

/Projects/ChatSecure-iOS/Pods/JSQMessagesViewController/JSQMessagesViewController/Categories/JSQSystemSoundPlayer+JSQMessages.m:29:42: No visible @interface https://github.com/interface for 'JSQSystemSoundPlayer' declares the selector 'playSoundWithName:extension:'

When I look in xcode at the pods that are installed I do see the JSQSystemSoundPlayer pod.

— Reply to this email directly or view it on GitHub https://github.com/chrisballinger/ChatSecure-iOS/issues/257.

chrisballinger avatar Oct 21 '14 18:10 chrisballinger

The reason is some of methods in JSQSystemSoundPlayer library are renamed, but the category JSQSystemSoundPlayer+JSQMessages in JSQMessagesViewController is still not updated. Just need to update category with code belows:

@implementation JSQSystemSoundPlayer (JSQMessages)

  • (void)jsq_playMessageReceivedSound { [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:kJSQMessageReceivedSoundName fileExtension:kJSQSystemSoundTypeAIFF];

}

  • (void)jsq_playMessageReceivedAlert { [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:kJSQMessageReceivedSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }
  • (void)jsq_playMessageSentSound { [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:kJSQMessageSentSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }
  • (void)jsq_playMessageSentAlert { [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:kJSQMessageSentSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }

@end

ngoclt avatar Oct 22 '14 07:10 ngoclt

This should be fixed in the latest commit

On Wed, Oct 22, 2014 at 12:19 AM, Tuan-Ngoc Le [email protected] wrote:

The reason is some of methods in JSQSystemSoundPlayer library are renamed, but the category JSQSystemSoundPlayer+JSQMessages in JSQMessagesViewController is still not updated. Just need to update category with code belows:

@implementation https://github.com/implementation JSQSystemSoundPlayer (JSQMessages)

  • (void)jsq_playMessageReceivedSound { [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:kJSQMessageReceivedSoundName fileExtension:kJSQSystemSoundTypeAIFF];

}

(void)jsq_playMessageReceivedAlert { [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:kJSQMessageReceivedSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }

(void)jsq_playMessageSentSound { [[JSQSystemSoundPlayer sharedPlayer] playSoundWithFilename:kJSQMessageSentSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }

(void)jsq_playMessageSentAlert { [[JSQSystemSoundPlayer sharedPlayer] playAlertSoundWithFilename:kJSQMessageSentSoundName fileExtension:kJSQSystemSoundTypeAIFF]; }

@end https://github.com/end

— Reply to this email directly or view it on GitHub https://github.com/chrisballinger/ChatSecure-iOS/issues/257#issuecomment-60045610 .

chrisballinger avatar Oct 22 '14 18:10 chrisballinger

I checked it and it works fine with latest version.

hydex86 avatar Oct 23 '14 17:10 hydex86

@hydex86 Great news!

chrisballinger avatar Oct 23 '14 17:10 chrisballinger

But it doesn't work with the iOS6_support_stable branch ...

robinmonjo avatar Oct 27 '14 11:10 robinmonjo

install through cocoapod.org as pod 'JSMessagesViewController', '~> 4.0' and but with the latest XCode 6 still got the same error message

dodo99 avatar Nov 16 '14 05:11 dodo99

@ngoclt's tip fixed it for me on XCode 6.1

bshyong avatar Nov 28 '14 09:11 bshyong

I have the same issue, using JSMessagesViewController (4.0.4) and JSQSystemSoundPlayer (2.0.0). I couldn't find the "JSQSystemSoundPlayer+JSQMessages" category explained above. Can anyone give a hand to solve the problem.

eraydiler avatar Dec 15 '14 17:12 eraydiler

@eraydiler : Use my code to resolve the problem.

ngoclt avatar Dec 15 '14 17:12 ngoclt

@ngoclt thanks for your answer but my point is where do i need to add your code exactly ?

eraydiler avatar Dec 15 '14 17:12 eraydiler

@eraydiler : JSQSystemSoundPlayer+JSQMessages.m

ngoclt avatar Dec 15 '14 18:12 ngoclt

@ngcolt Sorry for my poor understanding, but how can i add a category "JSQSystemSoundPlayer+JSQMessages.m" where there isn't a class called "JSQMessages.m" ? I have the "JSMessagesViewController" files, not "JSQMessagesViewController".

eraydiler avatar Dec 15 '14 18:12 eraydiler

Ok, i found out my problem... it was just because of the function names, and solved when i changed their names as follows;

playSoundWithName:extension - > playSoundWithFilename:fileExtension playAlertSoundWithName:extension -> playAlertSoundWithFilename:fileExtension

@ngoclt thanks for your help again.

eraydiler avatar Dec 15 '14 19:12 eraydiler

@eraydiler : Cheer ! PS: Actually this is not good way to resolve the problem. Do you use submodule to manage your 3rd party library ? If yes, you should fork this repo and update submodule by yourself. This way allows you to update latest code from JSMessagesViewController repo.

Good luck !

ngoclt avatar Dec 16 '14 01:12 ngoclt

I'm using the last pod version from here: http://cocoapods.org/?q=JSMessagesViewController

4.0.4

And I see that problem.

Ricardo1980 avatar Jan 19 '15 14:01 Ricardo1980

@Ricardo1980 : You should use the latest version to fix this issue. Check this link to know how: http://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions

PS: I think it's better to post these kinds of question to Stackoverflow instead of here.

ngoclt avatar Jan 19 '15 15:01 ngoclt

Yes. You are right in both replies. Thanks a lot :)

Enviado desde mi iPhone.

El 19/01/2015, a las 16:54, Tuan-Ngoc Le [email protected] escribió:

@Ricardo1980 : You should use the latest version to fix this issue. Check this link to know how: http://guides.cocoapods.org/using/the-podfile.html#specifying-pod-versions

PS: I think it's better to post these kinds of question to Stackoverflow instead of here.

— Reply to this email directly or view it on GitHub.

Ricardo1980 avatar Jan 19 '15 17:01 Ricardo1980

@ngoclt the latest version of JSMessagesViewController is version 4.0.4. So regardless if you are using the 'latest' version as you suggested or not the issue still exists when using cocoapods. Specifying version numbers allows you to freeze versions so you do not run into issues such as this one.

jault3 avatar Jan 21 '15 21:01 jault3

@jault3 : Make a double check. I'm pretty sure the latest version is not 4.0.4, it's 6.1.3 I saw that there are 2 sources on Cocoapods: JSQMessagesViewController (6.1.3) and JSMessagesViewController (4.0.4).

Use JSQMessagesViewController

pod 'JSQMessagesViewController'

ngoclt avatar Jan 22 '15 02:01 ngoclt