This is a migrated thread and some comments may be shown as answers.

Unable to import custom cordova swift plugin

5 Answers 241 Views
Command-Line Interface
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
umesh
Top achievements
Rank 1
umesh asked on 12 Jun 2015, 11:58 AM

Hello,
I've written a custom apache cordova plugin in swift for iOS platform and wants to integrate it into a hybrid appbuilder app but I'm keep getting following error:

Build errors: [ '[xcode-build] Check dependencies: Swift is unavailable on iOS earlier than 7.0; please set IPHONEOS_DEPLOYMENT_TARGET to 7.0 or later (currently it is \'6.0\').', Build failed with error code 2.

Its evident from the error message that I need to change the IPHONEOS_DEPLOYMENT_TARGET to 7.0 or later but unable to do it. Can you please suggest me how could I change it as .abproject doesn't have any deployment target tag.?

 

Note: I'm using Sublime Text 2 with AppBuilder (version:2.10.0-470) plugin installed on it for creating hybrid app. My plugin targets for Codova 3.8.0 while I've installed cordova 5.1.1 on my system.

5 Answers, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 17 Jun 2015, 08:44 AM
Hi Umesh,

As replied in your support ticket on the same matter:
"Swift is supported only on iOS 7 and above. Unfortunately, at this stage the AppBuilder cloud builds produce iOS application packages that, by default support iOS 6 and above. This disallows swift code inside them and so the build is failing with the mentioned by you error. In other words, the failure is due to the automatically set deployment target for AppBuilder iOS applications. This is also why you cannot set the IPHONEOS_DEPLOYMENT_TARGET to 7.0 manually for the project.

The good news is that, we plan to introduce a way for our customers to change this target in their projects. This will let you develop applications only for iOS 7 and above for example and will provide the necessary Swift support for iOS applications. The feature is scheduled for the upcoming AppBuilder 2.11 release, planned for late July.
"

Please, let me know if I can help with anything else.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
umesh
Top achievements
Rank 1
answered on 02 Aug 2015, 07:40 PM

Hi Kaloyan,

Can you please tell me how will I change the IPHONEOS_DEPLOYMENT_TARGET to 7.0 for deploying my hybrid app containing swift code on iOS 8+ devices ?

I'm still seeing only following project properties : iOSBackgroundMode, iOSDeviceFamily, iOSStatusBarStyle in response of $appbuilder prop print.

Thanks/Umesh 

 

 

0
Kaloyan
Telerik team
answered on 06 Aug 2015, 07:19 AM
Hi Umesh,

The project property is called iOSDeploymentTarget in the AppBuilder Command Line Interface and it is not shown, as it hasn't been changed for that project. To configure it, you can use the following command:
$ appbuilder prop set iOSDeploymentTarget 7.0

For more details, please check this article from our online documentation. Note that, you will have to select CLI from the upper right dropdown section.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
umesh
Top achievements
Rank 1
answered on 11 Aug 2015, 11:42 AM

Hi Kaloyan,

After changing the iOSDeploymentTarget to 7.0 I'm getting following error:

Build errors: [ '[xcode-build] Compile /tmp/builds/aP9aSmsPV2aQVwfpxO/app/Plugins/com.selfedu.echo/src/ios/Echo.swift:',
  'Error: Can\'t remove "/tmp/builds/aP9aSmsPV2aQVwfpxO/provisions/0bf5372b-3ab9-46ad-85c4-a7022eab89b7.mobileprovision": EACCES, unlink \'/tmp/builds/aP9aSmsPV2aQVwfpxO/provisions/0bf5372b-3ab9-46ad-85c4-a7022eab89b7.mobileprovision\'' ]
Package built with 'Development' provision type. Downloading package, instead of generating QR code.
Deploy manually to your device using iTunes.
Build failed. For more information read the build log.

I tried to google it but couldn't succeeded. Can you please help me on it ? Moreover it seems the article link is broken as unable to access the article.

Problem Definition: I've created a plugin in swift (plugman compliance) and I want to import it into a AppBuilder project.

 Thanks/Umesh

 

0
iliev
Telerik team
answered on 13 Aug 2015, 10:09 AM
Hello Umesh,

We have further investigated the error logs from our machines and it seems that AppBuilder doesn't correctly output the errors emitted from the swift compiler at the moment.

The error you are not seeing is that the swift compiler can't find the "CDVPlugin". This is caused by the missing SWIFT_OBJC_BRIDGING_HEADER.
I'm afraid that AppBuilder does not support adding custom build variables rendering the swift plugin development as unsupported at the moment.
Swift Plugin usage in AppBuilder will be enabled as soon as Cordova 4.0 for iOS gets released and integrated. For more information please take a look at this Pull Request which is merged in 4.0


Regards,
iliev
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Command-Line Interface
Asked by
umesh
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
umesh
Top achievements
Rank 1
iliev
Telerik team
Share this question
or