cordova-httpd icon indicating copy to clipboard operation
cordova-httpd copied to clipboard

Fails to build on PhoneGap Build with CLI 6

Open AshleyScirra opened this issue 9 years ago • 3 comments

Build something on PhoneGap Build with these lines in your config.xml:

<preference name="phonegap-version" value="cli-6.0.0" />
...
<plugin name="cordova-plugin-httpd" source="npm" />

Build fails with this in the error log:

In file included from /project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:34:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/usr/include/ifaddrs.h:31:1: error: missing '@end'
#include <Availability.h>
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:32:1: note: implementation started here
@implementation CorHttpd
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:50:1: error: missing context for method declaration
- (NSString *)getIPAddress:(BOOL)preferIPv4
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:68:1: error: missing context for method declaration
- (NSDictionary *)getIPAddresses
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:108:1: error: missing context for method declaration
- (void)pluginInitialize
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:119:1: error: missing context for method declaration
- (void)startServer:(CDVInvokedUrlCommand*)command
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:187:1: error: missing context for method declaration
- (void)stopServer:(CDVInvokedUrlCommand*)command
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:204:1: error: missing context for method declaration
- (void)getURL:(CDVInvokedUrlCommand *)command
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:211:1: error: missing context for method declaration
- (void)getLocalPath:(CDVInvokedUrlCommand *)command
^
/project/wkrenderperf/Plugins/cordova-plugin-httpd/CorHttpd.m:218:1: error: '@end' must appear in an Objective-C context
@end
^

This prevents us using this plugin to help support WKWebView in Construct 2.

AshleyScirra avatar Mar 22 '16 14:03 AshleyScirra

It works fine with Cordova CLI 5.x, build without any problem. After I upgrade CLI to 6.0, the error was reproduced.

Now looking into this issue.

floatinghotpot avatar Mar 23 '16 04:03 floatinghotpot

@AshleyScirra it's fixed and verified, please upgrade to v0.9.3. Thanks for the bug report.

floatinghotpot avatar Mar 23 '16 06:03 floatinghotpot

Looks like it builds now. Great, thanks for the quick fix!

AshleyScirra avatar Mar 23 '16 11:03 AshleyScirra