We’ve been successfully using the ACRCloud iOS SDK in our iOS app. You simply download it, add their XCFramework to your project, and add the following to your bridging header:
#import "ACRCloudConfig.h"
#import “ACRCloudRecognition.h"
We now need to move our code that uses ACRCloud into a framework. I am getting an error though. This is what I did:
- In Xcode select File > New > Project > iOS > Framework
- Set Language to Swift and create it
- Drag and drop the ACRCloudSDK.xcframework into the project
- In the MyFramework.h file, add the import statements from above - I understand frameworks do not support bridging headers so this is the location they should be added instead
- Add a test class in a new Swift file - seems this is required
class TestClass {
var acrClient: ACRCloudRecognition?
}
- Build the framework with command B
Result: I get the following errors:
/Users/Admin/Downloads/MyFramework/MyFramework/MyFramework.h:19:9: Include of non-modular header inside framework module 'MyFramework': '/Users/Admin/Library/Developer/Xcode/DerivedData/MyFramework-gcmepfcyafmmyugjhujjgyybneuo/Build/Products/Debug-iphonesimulator/include/ACRCloudRecognition.h’
Could not build Objective-C module ‘MyFramework'
I confirmed that the MyFramework.h file is in Build Phases > Headers > Public (nothing is in Project). I also tried changing Allow Non-modular Includes In Framework Modules to Yes. What is needed to make this work? Thanks!