eclipsesource / tabris-js

Create native mobile apps in JavaScript or TypeScript.
https://tabrisjs.com
BSD 3-Clause "New" or "Revised" License
1.4k stars 170 forks source link

iOS build service error - tabrismaps #703

Closed bFlood closed 8 years ago

bFlood commented 8 years ago

I'm getting this error when building the tabrismaps plugin on iOS, I'm using the nightly build version since I presume tabrismaps on iOS requires tabris1.5. I must be missing something easy

any help would be great.

on a related note, how would you reference an external cocoapod in a custom plugin (ex: the Google Maps for iOS cocoapod: https://cocoapods.org/pods/GoogleMaps )

thanks!

/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:12:25: error: use of undeclared type 'BasicWidget'
public class ESMarker : BasicWidget, MKAnnotation {
                        ^~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:18:22: error: use of undeclared type 'BasicWidget'
public class ESMap : BasicWidget, MKMapViewDelegate, UIGestureRecognizerDelegate {
                     ^~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:92:57: error: use of undeclared type 'TabrisClient'
    override init!(objectId: String!, andClient client: TabrisClient!) {
                                                        ^~~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:92:14: error: initializer does not override a designated initializer from its superclass
    override init!(objectId: String!, andClient client: TabrisClient!) {
    ~~~~~~~~ ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:104:113: error: use of undeclared type 'TabrisClient'
    required convenience public init!(objectId: String!, properties: [NSObject : AnyObject]!, andClient client: TabrisClient!) {
                                                                                                                ^~~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:122:32: error: method does not override any method from its superclass
    override public class func remoteObjectType() -> String {
    ~~~~~~~~                   ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:126:32: error: method does not override any method from its superclass
    public override class func remoteObjectProperties() -> NSMutableSet {
           ~~~~~~~~            ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:134:26: error: method does not override any method from its superclass
    public override func view() -> UIView! {
           ~~~~~~~~      ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:175:17: warning: non-@objc method 'mapView(_:regionWillChangeAnimated:)' cannot satisfy optional requirement of @objc protocol 'MKMapViewDelegate'
    public func mapView(mapView: MKMapView, regionWillChangeAnimated animated: Bool) {
                ^
    @objc 
MapKit.MKMapViewDelegate:3:26: note: requirement 'mapView(_:regionWillChangeAnimated:)' declared here
    optional public func mapView(mapView: MKMapView, regionWillChangeAnimated animated: Bool)
                         ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:166:17: warning: non-@objc method 'mapViewDidFinishRenderingMap(_:fullyRendered:)' cannot satisfy optional requirement of @objc protocol 'MKMapViewDelegate'
    public func mapViewDidFinishRenderingMap(mapView: MKMapView, fullyRendered: Bool) {
                ^
    @objc 
MapKit.MKMapViewDelegate:15:26: note: requirement 'mapViewDidFinishRenderingMap(_:fullyRendered:)' declared here
    optional public func mapViewDidFinishRenderingMap(mapView: MKMapView, fullyRendered: Bool)
                         ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:182:17: warning: non-@objc method 'mapView(_:didSelectAnnotationView:)' cannot satisfy optional requirement of @objc protocol 'MKMapViewDelegate'
    public func mapView(mapView: MKMapView, didSelectAnnotationView view: MKAnnotationView) {
                ^
    @objc 
MapKit.MKMapViewDelegate:23:26: note: requirement 'mapView(_:didSelectAnnotationView:)' declared here
    optional public func mapView(mapView: MKMapView, didSelectAnnotationView view: MKAnnotationView)
                         ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:18:14: error: type 'ESMap' does not conform to protocol 'NSObjectProtocol'
public class ESMap : BasicWidget, MKMapViewDelegate, UIGestureRecognizerDelegate {
             ^
ObjectiveC.NSObjectProtocol:2:17: note: protocol requires function 'isEqual' with type '(AnyObject?) -> Bool'
    public func isEqual(object: AnyObject?) -> Bool
                ^
ObjectiveC.NSObjectProtocol:3:16: note: protocol requires property 'hash' with type 'Int'
    public var hash: Int { get }
               ^
ObjectiveC.NSObjectProtocol:4:16: note: protocol requires property 'superclass' with type 'AnyClass?'
    public var superclass: AnyClass? { get }
               ^
ObjectiveC.NSObjectProtocol:7:17: note: protocol requires function 'self()' with type '() -> Self'
    public func `self`() -> Self
                ^
ObjectiveC.NSObjectProtocol:8:17: note: protocol requires function 'performSelector' with type '(Selector) -> Unmanaged!'
    public func performSelector(aSelector: Selector) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:9:17: note: protocol requires function 'performSelector(_:withObject:)' with type '(Selector, withObject: AnyObject!) -> Unmanaged!'
    public func performSelector(aSelector: Selector, withObject object: AnyObject!) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:10:17: note: protocol requires function 'performSelector(_:withObject:withObject:)' with type '(Selector, withObject: AnyObject!, withObject: AnyObject!) -> Unmanaged!'
    public func performSelector(aSelector: Selector, withObject object1: AnyObject!, withObject object2: AnyObject!) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:11:17: note: protocol requires function 'isProxy()' with type '() -> Bool'
    public func isProxy() -> Bool
                ^
ObjectiveC.NSObjectProtocol:12:17: note: protocol requires function 'isKindOfClass' with type '(AnyClass) -> Bool'
    public func isKindOfClass(aClass: AnyClass) -> Bool
                ^
ObjectiveC.NSObjectProtocol:13:17: note: protocol requires function 'isMemberOfClass' with type '(AnyClass) -> Bool'
    public func isMemberOfClass(aClass: AnyClass) -> Bool
                ^
ObjectiveC.NSObjectProtocol:14:17: note: protocol requires function 'conformsToProtocol' with type '(Protocol) -> Bool'
    public func conformsToProtocol(aProtocol: Protocol) -> Bool
                ^
ObjectiveC.NSObjectProtocol:15:17: note: protocol requires function 'respondsToSelector' with type '(Selector) -> Bool'
    public func respondsToSelector(aSelector: Selector) -> Bool
                ^
ObjectiveC.NSObjectProtocol:26:16: note: protocol requires property 'description' with type 'String'
    public var description: String { get }
               ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:14:99: warning: cast from 'NSObject' to unrelated type 'ESMarker' always fails
        return self.annotationsInMapRect(self.visibleMapRect).map { obj -> ESMarker in return obj as! ESMarker }
                                                                                              ~~~ ^   ~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:127:19: error: 'super' members cannot be referenced in a root class
        let set = super.remoteObjectProperties()
                  ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:159:26: error: use of undeclared type 'Notification'
            let message: Notification = notifications.forObject(self) as! Notification
                         ^~~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:169:30: error: use of undeclared type 'Notification'
                let message: Notification = self.notifications.forObject(self) as! Notification
                             ^~~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift:177:26: error: use of undeclared type 'Notification'
            let message: Notification = notifications.forObject(self) as! Notification
                         ^~~~~~~~~~~~
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:12:14: error: type 'ESMarker' does not conform to protocol 'MKAnnotation'
public class ESMarker : BasicWidget, MKAnnotation {
             ^
MapKit.MKAnnotation:2:16: note: protocol requires property 'coordinate' with type 'CLLocationCoordinate2D'
    public var coordinate: CLLocationCoordinate2D { get }
               ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:24:16: note: candidate is not '@objc', but protocol requires it
    public var coordinate: CLLocationCoordinate2D
               ^
           @objc 
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:25:16: warning: non-@objc property 'title' cannot satisfy optional requirement of @objc protocol 'MKAnnotation'
    public var title: String?
               ^
           @objc 
MapKit.MKAnnotation:3:25: note: requirement 'title' declared here
    optional public var title: String? { get }
                        ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:26:16: warning: non-@objc property 'subtitle' cannot satisfy optional requirement of @objc protocol 'MKAnnotation'
    public var subtitle: String?
               ^
           @objc 
MapKit.MKAnnotation:4:25: note: requirement 'subtitle' declared here
    optional public var subtitle: String? { get }
                        ^
/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMarker.swift:12:14: error: type 'ESMarker' does not conform to protocol 'NSObjectProtocol'
public class ESMarker : BasicWidget, MKAnnotation {
             ^
ObjectiveC.NSObjectProtocol:2:17: note: protocol requires function 'isEqual' with type '(AnyObject?) -> Bool'
    public func isEqual(object: AnyObject?) -> Bool
                ^
ObjectiveC.NSObjectProtocol:3:16: note: protocol requires property 'hash' with type 'Int'
    public var hash: Int { get }
               ^
ObjectiveC.NSObjectProtocol:4:16: note: protocol requires property 'superclass' with type 'AnyClass?'
    public var superclass: AnyClass? { get }
               ^
ObjectiveC.NSObjectProtocol:7:17: note: protocol requires function 'self()' with type '() -> Self'
    public func `self`() -> Self
                ^
ObjectiveC.NSObjectProtocol:8:17: note: protocol requires function 'performSelector' with type '(Selector) -> Unmanaged!'
    public func performSelector(aSelector: Selector) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:9:17: note: protocol requires function 'performSelector(_:withObject:)' with type '(Selector, withObject: AnyObject!) -> Unmanaged!'
    public func performSelector(aSelector: Selector, withObject object: AnyObject!) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:10:17: note: protocol requires function 'performSelector(_:withObject:withObject:)' with type '(Selector, withObject: AnyObject!, withObject: AnyObject!) -> Unmanaged!'
    public func performSelector(aSelector: Selector, withObject object1: AnyObject!, withObject object2: AnyObject!) -> Unmanaged!
                ^
ObjectiveC.NSObjectProtocol:11:17: note: protocol requires function 'isProxy()' with type '() -> Bool'
    public func isProxy() -> Bool
                ^
ObjectiveC.NSObjectProtocol:12:17: note: protocol requires function 'isKindOfClass' with type '(AnyClass) -> Bool'
    public func isKindOfClass(aClass: AnyClass) -> Bool
                ^
ObjectiveC.NSObjectProtocol:13:17: note: protocol requires function 'isMemberOfClass' with type '(AnyClass) -> Bool'
    public func isMemberOfClass(aClass: AnyClass) -> Bool
                ^
ObjectiveC.NSObjectProtocol:14:17: note: protocol requires function 'conformsToProtocol' with type '(Protocol) -> Bool'
    public func conformsToProtocol(aProtocol: Protocol) -> Bool
                ^
ObjectiveC.NSObjectProtocol:15:17: note: protocol requires function 'respondsToSelector' with type '(Selector) -> Bool'
    public func respondsToSelector(aSelector: Selector) -> Bool
                ^
ObjectiveC.NSObjectProtocol:26:16: note: protocol requires property 'description' with type 'String'
    public var description: String { get }
               ^
ERROR building one of the platforms: Error: /Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
** BUILD FAILED **
The following build commands failed:
    CompileSwift normal arm64 /Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/cordova/build-debug.xcconfig,-project,SDL Mobile.xcodeproj,ARCHS=armv7 armv7s arm64,-target,SDL Mobile,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/build/sharedpch
Error: /Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Warning: Command failed: /bin/sh -c cordova build --device
* BUILD FAILED *
The following build commands failed:
    CompileSwift normal arm64 /Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/SDL Mobile/Plugins/com.eclipsesource.tabris.maps/ESMap.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(2 failures)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/cordova/build-debug.xcconfig,-project,SDL Mobile.xcodeproj,ARCHS=armv7 armv7s arm64,-target,SDL Mobile,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/build/sharedpch
Error: /Users/travis/build/eclipsesource/tabris-js-build-template/build/platforms/ios/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
 Use --force to continue.
Aborted due to warnings.
travis_time:end:22daf610:start=1450102052933604000,finish=1450102397333197000,duration=344399593000

The command "grunt build deploy" exited with 6.
travis_fold:start:after_script.1
travis_time:start:04326a84
$ security delete-keychain ios-build.keychain
travis_time:end:04326a84:start=1450102397353974000,finish=1450102397390421000,duration=36447000
travis_fo
jkrause commented 8 years ago

Strange. Did you have a look at the config.xml of the maps example project? It also uses nightly and builds just fine for iOS: https://github.com/eclipsesource/tabris-maps-example/

bFlood commented 8 years ago

I have more plugins defined but the tabris-maps plugin section is identical. I'll run it again and see what happens

bFlood commented 8 years ago

same error, full build log here: https://gist.github.com/bFlood/6d16ad9329a36b8213d3

patrykmol commented 8 years ago

Does your project has spaces in it's name? Could send Xcode project file (projectname.xcodeproj - it may be appear as directory on non-OSX OSes) for me to investigate? It would be great if you could also attach bridging header (file has "-Bridging-Header.h" suffix in it's name).

bFlood commented 8 years ago

I don't have an xcodeproj file, I'm only using the tabris build server

my project name did have a space but when I removed it the same errors occured

thanks!

bFlood commented 8 years ago

when I fork the tabris-maps-example, it compiles just fine. I did notice that it's config.xml is in the root folder whereas mine is in a "cordova" folder like in the tabris getting started app: https://github.com/eclipsesource/tabris-js-getting-started

maybe https://github.com/eclipsesource/tabris-maps/blob/master/scripts/setup-bridging-header.js is getting confused?

patrykmol commented 8 years ago

You should change your project so it would like the tabris-maps-example projects structure.

bFlood commented 8 years ago

is that the recommended project structure for tabris.js apps when using the tabris build service? why is the getting-started (and other tabris exmaples) different? fwiw, I think I started with that folder structure originally and then had to switch to one with an isolated "cordova" folder

I'll give it try for this issue and let you know but it would be very helpful to have a single, known folder structure for all tabris apps (built locally or via the build service)

bFlood commented 8 years ago

ok, I moved around the project folder to match tabris-maps-example and I still get the exact same error on the build service. any thoughts? I was hoping 1.5 would solve all the maps issues but now I can't even get them to work on android either https://github.com/eclipsesource/tabris-js/issues/707

bFlood commented 8 years ago

I have no idea what changed but I just tried compiling again and it works!

thanks tabris

bFlood commented 8 years ago

the change of cordova versions on the build server have broken the hook scripts for iOS

cookieguru commented 8 years ago

@bFlood What's in your script? Mine is still working.

bFlood commented 8 years ago

the scripts are running, its just code for getting the cordova project folder, platform parser and possibly other stuff is broken with the new cordova version. also, I'm using the "nightly" build server

script is similar to this one: https://github.com/eclipsesource/tabris-maps/blob/master/scripts/custom-widget.js

after changing the code and getting the requireCordovaModule calls to work, I'm now getting this error:

Failed to install 'com.spatialdatalogic.tabris.gmaps':TypeError: platforms[platform].parser is not a function
    at getProjectFile (/Users/travis/build/eclipsesource/tabris-js-build-template/build/plugins/com.spatialdatalogic.tabris.gmaps/scripts/custom-widget.js:28:20)
    at updateIOSAppDelegate (/Users/travis/build/eclipsesource/tabris-js-build-template/build/plugins/com.spatialdatalogic.tabris.gmaps/scripts/custom-widget.js:48:27)
    at module.exports (/Users/travis/build/eclipsesource/tabris-js-build-template/build/plugins/com.spatialdatalogic.tabris.gmaps/scripts/custom-widget.js:75:5)
    at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:167:18)
    at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:145:16)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:130:20
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:810:14
patrykmol commented 8 years ago

We'll fix them as soon as we have stabilized situation with Cordova 6.

bFlood commented 8 years ago

is there a timeline? as of right now we cannot build for iOS?

patrykmol commented 8 years ago

@bFlood I have updated Cordova hooks and successfully built tabris-maps-example with our build service using nightly. Please give it a try.

bFlood commented 8 years ago

thank you, works for me as well!

fyi - this issue is still present https://github.com/eclipsesource/tabris-js/issues/768