Skip to content

Wrong text merged in Briding-Header.h #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IvoMoor opened this issue Jul 7, 2017 · 2 comments
Closed

Wrong text merged in Briding-Header.h #31

IvoMoor opened this issue Jul 7, 2017 · 2 comments

Comments

@IvoMoor
Copy link

IvoMoor commented Jul 7, 2017

Hi,

By using your cordova plugin, I was able to create my own plugin using Swift 3. The plugin I created requires the CommonCrypto framework which needs to be added to the Bridging-Header file.

In order to do so, in my plugin.xml file I added:

<header-file src="MyPlugin-Bridging-Header.h"/>

Pointing to a file containing:

#import <CommonCrypto/CommonCrypto.h>

As dependency in the plugin.xml file I added:

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

After adding my plugin to my project, the Bridging-Header.h file in "Other Resources" has been changed, but instead of the file contents (# import <CommonCrypto/CommonCrypto.h>), the name of the file is merged. So the contents of the Bridging-Heder.h file is:

#import <Cordova/CDV.h>
#import "MyPlugin-Bridging-Header.h"

Am I doing anything wrong? Or is this a bug?

@akofman
Copy link
Owner

akofman commented Jul 7, 2017

Hello !

To me your Bridging-Header.h file looks good like that. Maybe you need to add CommonCrypto/CommonCrypto.h as an header file in your plugin.xml ?

What's your actual error ?

@IvoMoor
Copy link
Author

IvoMoor commented Jul 7, 2017

Ah, now I see. Sorry, my mistake. I expected the Bridging-Header.h file to look like:

#import <Cordova/CDV.h>
#import CommonCrypto/CommonCrypto.h

But I understand now that the Bridging-Header.h file is importing my header file which on its own contains the CommonCrypto library. So it looks like:

#import <Cordova/CDV.h>
#import "MyPlugin-Bridging-Heder.h"

Clear. It is working correctly. I am able to build my application.

Thanks!

Ivo

@IvoMoor IvoMoor closed this as completed Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants