Open MBuchalik opened 6 years ago
Did you ever manage to resolve this issue?
Unfortunately, I don't have access to my sample project right now. But I am pretty sure that I managed to successfully compile the project after adding a Brigding Header to the Swift plugin.
I think this is how I did it (was a pretty long time ago so not sure if this is really the correct way).
At the beginning, I only had the file src/ios/Example.swift
. This would not compile.
Then, I added a Bridging Header: Created a file src/ios/Example-Bridging-Header.h
. Here, I added the following content:
#import <Cordova/CDV.h>
In plugin.xml
, you could originally only find this line:
<source-file src="src/ios/Example.swift" />
I added the reference to the Bridging Header:
<source-file src="src/ios/Example.swift" />
<header-file src="src/ios/Example-Bridging-Header.h" />
I believe this is all what needed to be done. Hope it helps. 😃 As far as I remember, nothing had to be changed in config.xml
(except for referencing the new plugin branch of course).
Did not resolve the issue since I am not sure if it really fixes the problem in all cases.
Hi,
it looks like Swift isn't configured properly on PGB. When trying to include a plugin that uses Swift, you get the message
According to the Preferences Documentation (http://docs.phonegap.com/phonegap-build/configuring/preferences/#swift-version), a default Swift version is configured. Also, it is possible to set it using the
swift-version
preference. Unfortunately, it seems like this doesn't work.Is this a problem with the new Xcode version or has the introduction of Cocoapods caused trouble?
(I have also posted this question on the PGB forum a few days ago, of course.)
For testing, I have created a really small application:
The full log:
Edit: @goya I saw in #521 that PGB did have Swift (beta) support in 2016. Has this been removed again or is it currently only a missing parameter somewhere?