iOS release build failing

I’m trying to submit my application for review on the apps store with the ionic publishing tutorial http://ionicframework.com/docs/v1/guide/publishing.html.

I’m not being able to run this comman “ionic cordova build ios --release” witch gives me the following output. I have no idea what it means or why it happens. I’d apreciate some enlightenment! Thanks.

Jhonatass-Mac:blue_mobile_app jhonatasrosendo$ sudo ionic cordova build ios --release
Password:
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[07:46:52]  build dev started ...
[07:46:52]  clean started ...
[07:46:52]  clean finished in 13 ms
[07:46:52]  copy started ...
[07:46:52]  transpile started ...
[07:46:58]  transpile finished in 5.75 s
[07:46:58]  preprocess started ...
[07:46:58]  deeplinks started ...
[07:46:58]  deeplinks finished in 211 ms
[07:46:58]  preprocess finished in 212 ms
[07:46:58]  webpack started ...
[07:46:59]  copy finished in 6.70 s
[07:47:17]  webpack finished in 19.07 s
[07:47:17]  sass started ...
[07:47:36]  sass finished in 18.42 s
[07:47:36]  postprocess started ...
[07:47:39]  postprocess finished in 3.35 s
[07:47:39]  lint started ...
[07:47:39]  build dev finished in 47.28 s
> cordova build ios --release
⠇ Running command [07:48:40]  tslint: src/providers/oportunidades.ts, line: 2
            Unused import: 'RequestOptionsArgs'

       L1:  import { Injectable } from '@angular/core';
       L2:  import { Http, URLSearchParams, RequestOptionsArgs, RequestOptions, Headers } from '@angular/http';
       L3:  import 'rxjs/add/operator/map';

[07:48:40]  tslint: src/providers/oportunidades.ts, line: 2
            Unused import: 'RequestOptions'

       L1:  import { Injectable } from '@angular/core';
       L2:  import { Http, URLSearchParams, RequestOptionsArgs, RequestOptions, Headers } from '@angular/http';
       L3:  import 'rxjs/add/operator/map';

[07:48:40]  tslint: src/providers/oportunidades.ts, line: 2
            Unused import: 'Headers'

       L1:  import { Injectable } from '@angular/core';
       L2:  import { Http, URLSearchParams, RequestOptionsArgs, RequestOptions, Headers } from '@angular/http';
       L3:  import 'rxjs/add/operator/map';

[07:48:40]  tslint: src/pages/editar-oportunidade/editar-oportunidade.ts, line: 3
            Unused import: 'Validators'

       L2:  import { IonicPage, NavParams, Loading, LoadingController, AlertController, ViewController, Events } from 'ionic-angular';
       L3:  import { Validators, FormBuilder, FormGroup } from '@angular/forms';

[07:48:40]  tslint: src/pages/filtro-oportunidades/filtro-oportunidades.ts, line: 3
            Unused import: 'Validators'

       L2:  import { IonicPage, NavController, NavParams, ViewController, Loading, LoadingController, AlertController, Events } from 'ionic-angular';
       L3:  import { Validators, FormBuilder, FormGroup } from '@angular/forms';
⠏ Running command        L4:  import { VariaveisGlobaisProvider } from '../../providers/variaveis-globais';

[07:48:40]  tslint: src/pages/registrar-contato/registrar-contato.ts, line: 2
            Unused import: 'Loading'

       L1:  import { Component } from '@angular/core';
       L2:  rt { IonicPage, NavController, NavParams, ViewController, Loading, LoadingController, AlertController, Event
       L3:  import { Validators, FormBuilder, FormGroup } from '@angular/forms';

[07:48:40]  tslint: src/pages/registrar-contato/registrar-contato.ts, line: 3
            Unused import: 'Validators'

       L2:  import { IonicPage, NavController, NavParams, ViewController, Loading, LoadingController, AlertController, Events } from 'ionic-angular';
       L3:  import { Validators, FormBuilder, FormGroup } from '@angular/forms';

[07:48:40]  lint finished in 61.02 s
✖ Running command - failed!
[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build ios --release (exit code 1):

        (truncated) ... gnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules
        -gmodules -fmodules-cache-path=/var/root/Library/Developer/Xcode/DerivedData/ModuleCache
        -fmodules-prune-interval=86400 -fmodules-prune-after=345600
        -fbuild-session-file=/var/root/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation
        -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers
        -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match
        -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter
        -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow
        -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion
        -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match
        -Wundeclared-selector -Wno-deprecated-implementations -isysroot
        /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk
        -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g
        -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -fobjc-abi-version=2 -fobjc-legacy-dispatch
        -iquote
		/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Blue\ Service-generated-files.hmap
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Blue\ Service-own-target-headers.hmap
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Blue\ Service-all-target-headers.hmap -iquote
        /var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Blue\ Service-project-headers.hmap
        -I/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/emulator/include
        -I/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/emulator/usr/local/lib/include
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/UninstalledProducts/include
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/UninstalledProducts/iphonesimulator/include
        -I/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/emulator
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/DerivedSources/i386
        -I/var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/DerivedSources
        -F/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/emulator -include
        /Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/sharedpch/Blue\
        Service-Prefix-airpclgoucqlptfaqieocgtfbcnq/Blue\ Service-Prefix.pch -MMD -MT dependencies -MF
        /var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Objects-normal/i386/main.d --serialize-diagnostics
        /var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Objects-normal/i386/main.dia -c
        /Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/Blue\ Service/main.m -o
        /var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Objects-normal/i386/main.o

        ** BUILD FAILED **


        The following build commands failed:
        CompileC
        /var/root/Library/Developer/Xcode/DerivedData/Blue_Service-ezyfxyamvhytbqaszydxvynacjdc/Build/Intermediates/Blue\
        Service.build/Release-iphonesimulator/Blue\ Service.build/Objects-normal/i386/AppDelegate.o Blue\
        Service/Classes/AppDelegate.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        (1 failure)
        Error: Error code 65 for command: xcodebuild with args:
        -xcconfig,/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/cordova/build-release.xcconfig,-workspace,Blue
        Service.xcworkspace,-scheme,Blue Service,-configuration,Release,-sdk,iphonesimulator,-destination,platform=iOS
        Simulator,name=iPhone
        SE,build,CONFIGURATION_BUILD_DIR=/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/jhonatasrosendo/dev/blue_mobile_app/platforms/ios/build/shar
edpch

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

As you are using Ionic (not Ionic v1) you should not follow v1 documentation. Use this for example: http://ionicframework.com/docs/intro/deploying/

Thanks for the tip!

The link you sent is about deploying the app to the device, which I can do already.

What I want is to build it in order to submit it to be reviewed by Apple. Also, “ionicframework.com/docs/v2/guide/publishing.html” redirects to “http://ionicframework.com/docs/v1/guide/publishing.html” so I thought the app publishing process is the same for ionic 2/3.

Also, I was able to build after chmod 777 on project directory, removing and re-adding ios platform and running ionic cordova resources. After that, i could run the build command successfully!