Ionic app with Cordova plugin that references Swift Framework

Hi,

I have an Ionic app which is referencing a Cordova plugin that we are developing. The Cordova plugin is referencing an iOS Framework which is created/developed in Swift.

The plugin’s config.xml is like this (note dependency on cordova-plugin-add-swift-support:

...
<dependency id="cordova-plugin-add-swift-support" version="1.7.2" />

<js-module name="Native" src="www/Native.js">
        <clobbers target="NativeFunction" />
    </js-module>
<platform name="ios">
    <config-file target="config.xml" parent="/*">
        <feature name="NativeFunction">
            <param name="ios-package" value="NativeFunction"/>
            <param name="onload" value="true" />
        </feature>
    </config-file>
    <source-file src="src/ios/NativeFunction.swift" />

    <framework src="src/ios/MyCorePlatform.framework" custom="true" embed="true"/>
</platform>

I’m then trying to reference the framework in my Swift class:

import MyCorePlatform

@objc(NativeFunction)
class NativeFunction : CDVPlugin {
    
    @objc(getVersion:)
    func getVersion(command: CDVInvokedUrlCommand) {
        // 
    }
}

I’m trying this in Xcode, after doing an ionic cordova prepare ios command. When I try and compile, I am getting the following error:

Could not build Objective-C module 'MyCorePlatform'

Has anyone faced this before and can offer any suggestions?

Can you elaborate a little more about the unusual behavior after running this?

If I have the framework referenced in my plugin (see above config.xml), but don’t utilize any code from it, I can still build the project and run it on a device.

However, when I try and update my plugin’s Swift file to reference the framework, I get errors:

Error on the import statement:
Could not build Objective-C module 'OLBCore'

Error when trying to reference a class from the framework:
Use of unresolved identifier 'MyAppConfig'

And then the app doesn’t build anymore and I can’t run it.

I am not sure I could be any help at this point. Sorry.