Ionic build error on ios platform


#1

Hi, i’m developing my first Ionic app. I encountered a problem building ios app on Mac OsX. I got error code 1, related to Geofence Plugin. A lot of compilation errors related to this plugin.

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.
        
[DEBUG] !!! ERROR ENCOUNTERED !!!
[ERROR] An error occurred while running cordova build ios (exit code 1):
        
        (truncated) ...                    ^~~~~~~~~~~~~~~~
        <unknown>:0: note: did you mean 'NSLocaleIdentifier'?
        CoreFoundation.CFLocaleIdentifier:1:15: note: did you mean
        'CFLocaleIdentifier'?
        public struct CFLocaleIdentifier : RawRepresentable,
        _SwiftNewtypeWrapper {
        ^
        <unknown>:0: note: did you mean 'kCFLocaleIdentifier'?
        Swift.ObjectIdentifier:5:15: note: did you mean 'ObjectIdentifier'?
        public struct ObjectIdentifier : Hashable {
        ^
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1867:23: error:
        use of unresolved identifier 'executeQuery'
        let results = executeQuery(sqlStr)
        ^~~~~~~~~~~~
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1927:23: error:
        use of unresolved identifier 'executeQuery'
        let results = executeQuery(sqlStr)
        ^~~~~~~~~~~~
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1950:23: error:
        use of unresolved identifier 'executeQuery'
        let results = executeQuery(sqlStr)
        ^~~~~~~~~~~~
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:2143:21: error:
        'stringByAppendingPathComponent' has been renamed to
        'appendingPathComponent(_:)'
        return nsSt.stringByAppendingPathComponent(path)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        appendingPathComponent
        <unknown>:0: note: 'stringByAppendingPathComponent' was obsoleted in
        Swift 3
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:2150:21: error:
        'stringByAppendingPathExtension' has been renamed to
        'appendingPathExtension(_:)'
        return nsSt.stringByAppendingPathExtension(ext)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        appendingPathExtension
        <unknown>:0: note: 'stringByAppendingPathExtension' was obsoleted in
        Swift 3
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:340:13: error:
        closure use of non-escaping parameter 'closure' may allow it to escape
        closure()
        ^
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:325:63: note:
        parameter 'closure' is implicitly non-escaping
        public static func executeWithConnection(flags: SD.Flags, closure:
        ()->Void) -> Int? {
        ^
        @escaping
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:878:16: error:
        closure use of non-escaping parameter 'transactionClosure' may allow it
        to escape
        if transactionClosure() {
        ^
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:856:36: note:
        parameter 'transactionClosure' is implicitly non-escaping
        public static func transaction(transactionClosure: ()->Bool) -> Int? {
        ^
        @escaping
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:942:16: error:
        closure use of non-escaping parameter 'savepointClosure' may allow it to
        escape
        if savepointClosure() {
        ^
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:920:34: note:
        parameter 'savepointClosure' is implicitly non-escaping
        public static func savepoint(savepointClosure: ()->Bool) -> Int? {
        ^
        @escaping
        
        ** BUILD FAILED **
        
        
        The following build commands failed:
        CompileSwift normal x86_64
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/GeofencePlugin.swift
        CompileSwift normal x86_64
        /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona
        Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
        (3 failures)
        Error: Error code 65 for command: xcodebuild with args:
        -xcconfig,/Users/developer/Downloads/Cremona_Circuit/platforms/ios/cordova/build-debug.xcconfig,-workspace,Cremona
        Circuit.xcworkspace,-scheme,Cremona
        Circuit,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS
        Simulator,name=iPhone
        5s,build,CONFIGURATION_BUILD_DIR=/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/sharedpch

Ionic info:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 6.5.0 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 ios 4.3.1
    Ionic Framework                 : ionic-angular 3.0.0

System:

    Node       : v6.10.2
    OS         : macOS Sierra
    Xcode      : Xcode 8.3 Build version 8E162 
    ios-deploy : 1.9.1 
    ios-sim    : 5.0.13 
    npm        : 3.10.10 

#2

Any solutions?:slight_smile:


#3

Did you do what the error message tells you to do?


#4

I executed the command “cordova build ios”. At some point i receive many compilation error, starting from


 CompileSwift normal x86_64 /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/GeofencePlugin.swift
    cd /Users/developer/Downloads/Cremona_Circuit/platforms/ios
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file "/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/GeofencePlugin.swift" "/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift" "/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftyJson.swift" -target x86_64-apple-ios8.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -I /Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator -F /Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator -F "Cremona Circuit/Plugins/cordova-plugin-facebook4" -g -module-cache-path /Users/developer/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc "-I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/swift-overrides.hmap" -Xcc -iquote -Xcc "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Cremona Circuit-generated-files.hmap" -Xcc "-I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Cremona Circuit-own-target-headers.hmap" -Xcc "-I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Cremona Circuit-all-target-headers.hmap" -Xcc -iquote -Xcc "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Cremona Circuit-project-headers.hmap" -Xcc -I/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator/include -Xcc -I/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator/usr/local/lib/include -Xcc -I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/UninstalledProducts/include -Xcc -I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/UninstalledProducts/iphonesimulator/include -Xcc -I/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator -Xcc "-I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/DerivedSources/x86_64" -Xcc "-I/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/DerivedSources" -Xcc -DDEBUG=1 -Xcc -working-directory/Users/developer/Downloads/Cremona_Circuit/platforms/ios -emit-module-doc-path "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin~partial.swiftdoc" -serialize-diagnostics-path "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin.dia" -import-objc-header "/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Bridging-Header.h" -Onone -module-name Cremona_Circuit -emit-module-path "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin~partial.swiftmodule" -emit-dependencies-path "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin.d" -emit-reference-dependencies-path "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin.swiftdeps" -o "/Users/developer/Library/Developer/Xcode/DerivedData/Cremona_Circuit-havtorivtvfwvhajcmdbczrbmxbk/Build/Intermediates/Cremona Circuit.build/Debug-iphonesimulator/Cremona Circuit.build/Objects-normal/x86_64/GeofencePlugin.o"
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftyJson.swift:181:39: error: '=' has been replaced with ':' in attribute arguments
    @available(*, unavailable, renamed="null")
                                      ^
                                      : 
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftyJson.swift:897:35: error: expected ',' joining parts of a multi-clause condition
        if let errorValue = error where errorValue.code == ErrorNotExist{
                                 ~^~~~~
                                 ,
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1612:21: error: 'SQLiteDB' is inaccessible due to 'private' protection level
extension SwiftData.SQLiteDB {
                    ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1036:19: note: type declared here
    private class SQLiteDB {
                  ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1831:21: error: 'SQLiteDB' is inaccessible due to 'private' protection level
extension SwiftData.SQLiteDB {
                    ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1036:19: note: type declared here
    private class SQLiteDB {
                  ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1971:21: error: 'SDError' is inaccessible due to 'private' protection level
extension SwiftData.SDError {
                    ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift:1603:20: note: type declared here
    private struct SDError {
                   ^
/Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftyJson.swift:274:26: error: 'ForwardIndexType' has been renamed to 'Comparable'
public struct JSONIndex: ForwardIndexType, _Incrementable, Equatable, Comparable {
                         ^~~~~~~~~~~~~~~~
                         Comparable
Swift.ForwardIndexType:2:18: note: 'ForwardIndexType' has been explicitly marked unavailable here
public typealias ForwardIndexType = Swift.Void
                 ^


and finish with this:

** BUILD FAILED **


The following build commands failed:
	CompileSwift normal x86_64 /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/GeofencePlugin.swift
	CompileSwift normal x86_64 /Users/developer/Downloads/Cremona_Circuit/platforms/ios/Cremona Circuit/Plugins/cordova-plugin-geofence/SwiftData.swift
	CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(3 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/developer/Downloads/Cremona_Circuit/platforms/ios/cordova/build-debug.xcconfig,-workspace,Cremona Circuit.xcworkspace,-scheme,Cremona Circuit,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 5s,build,CONFIGURATION_BUILD_DIR=/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/developer/Downloads/Cremona_Circuit/platforms/ios/build/sharedpch

maybe is connected with sqlite?


#5

No, error message explicitly mentions the geo fence plugin. So I think this is more a case for https://github.com/cowbell/cordova-plugin-geofence/issues than here.

(Try removing and re-adding the iOS platform, maybe you are lucky and this fixes things.)


#6

Hi, now everything is working fine. I used this fork https://github.com/compelling/cordova-plugin-geofence/ and no problems… Thanks