Can't compile (JSQSystemSoundPlayer playSoundWithName:extension not declared)
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.
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.
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
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 .
I checked it and it works fine with latest version.
@hydex86 Great news!
But it doesn't work with the iOS6_support_stable branch ...
install through cocoapod.org as pod 'JSMessagesViewController', '~> 4.0' and but with the latest XCode 6 still got the same error message
@ngoclt's tip fixed it for me on XCode 6.1
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 : Use my code to resolve the problem.
@ngoclt thanks for your answer but my point is where do i need to add your code exactly ?
@eraydiler : JSQSystemSoundPlayer+JSQMessages.m
@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".
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 : 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 !
I'm using the last pod version from here: http://cocoapods.org/?q=JSMessagesViewController
4.0.4
And I see that problem.
@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.
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.
@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 : 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'