aws / amazon-chime-sdk-ios

An iOS client library for integrating multi-party communications powered by the Amazon Chime service.
https://aws.amazon.com/chime/chime-sdk/
Apache License 2.0
139 stars 64 forks source link

Compilation Errors when using Amazon SDK SPM #672

Closed arehman86 closed 1 month ago

arehman86 commented 2 months ago

Describe the bug I have an objective-c project which I am working on right now. Previously I have downloaded xcframeworks and used it manually but now I have to use SPM. So I removed xcframeworks from the project and used SPM with video. When compiling the code I am getting compilation errors. I am importing the header like this #import <AmazonChimeSDK/AmazonChimeSDK-Swift.h> but getting compilation errors in this header.

To Reproduce Add Amazon chime sdk spm to the project and import the header AmazonChimeSDK/AmazonChimeSDK-Swift.h and try to compile. It will give compilation errors.

Screenshots image

georgezy-amzn commented 1 month ago

Hi @arehman86, did you import AVFoundation? #import <AVFoundation/AVFoundation.h>

arehman86 commented 1 month ago

@georgezy-amzn yes I have done that but it didnt work. There are other errors along with the errors of AVFoundation. Do you want me to prepare a sample project and share it with you guys?

Screenshot 2024-05-23 at 12 17 28 PM
georgezy-amzn commented 1 month ago

Yes, please share us a sample project.

arehman86 commented 1 month ago

@georgezy-amzn There is a ViewController.mm file in which I added #import <AmazonChimeSDK/AmazonChimeSDK-Swift.h>. I think it is due to Objective-C++ because when I use simply with ViewController.m then it works fine. But in our case we need to use it with Objective-C++. Code sample is attached.

amazon-chime-sample.zip

arehman86 commented 1 month ago

@georgezy-amzn any update on this one?

arehman86 commented 1 month ago

@georgezy-amzn Can you please update me on the sample project which I shared with you? Is there anything we need to do on our side to fix the issue?

georgezy-amzn commented 1 month ago

Your project is using .mm files, which is for c++, please use .m.