Ionic CLI Build Error - ios

I've been able to successfully using the Ionic CLI to build my iOS packages in the past, but I have a set of errors that I can't get rid of. The archive is succeeding, but I'm still having a few issues.
1) Even if I'm using the ionic build ios command, it's creating an archive package and not the build package.
2) I'm getting some IDEDistribution errors:
** ARCHIVE SUCCEEDED **
Non-system Ruby in use. This may cause packaging to fail.
If you use RVM, please run `rvm use system`.
If you use chruby, please run `chruby system`.
2017-03-15 10:00:54.132 xcodebuild[11254:474630] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/v9/dqmqkj455rjbmq4n9gg4dc4m0000gn/T/ExampleSQLite_2017-03-15_10-00-54.131.xcdistributionlogs'.
1.2.840.113635.100.1.61
Exported ExampleSQLite.xcarchive to: /Applications/XAMPP/xamppfiles/htdocs/dev/_ionic/ExampleSQLite/platforms/ios/build/device
** EXPORT SUCCEEDED **
This error occurs even after I've run the rvm use system command.
Is the archive setting something in XCode settings? If I try ionic build android it builds properly (meaning it doesn't archive, I get a BUILD SUCCEEDED message).
For reference, here is my system info:
Your system information:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.4
ios-deploy version: 1.9.1
ios-sim version: 5.0.4
OS: macOS Sierra
Node Version: v7.5.0
Xcode version: Xcode 8.2.1 Build version 8C1002
I've tried uninstalling and reinstalling XCode with no change.

Was getting the same error and in my case, it turned out that the problem was caused because I had my device plugged to the computer during the Cordova build.
I just unplugged it and works.

It turned out that I had two iOS Developer Keys in my Keychain Access which was causing the error. Once I deleted that one and tried to build, the error went away.
If you have the same issue, go to Keychain Access > Keys and look for ones that start with iOS Developer... if you have any duplicates installed just delete them and reinstall and you should be all set.

I was getting the same error and in my case, it turned out that the problem was caused because I had my device plugged to the computer during the Cordova build.
I just unplugged it and works.

Related

Phonegap-nfc plugin causes build to fail on xcode

I am using ionic 5 capacitor and i am trying to get phonegap-nfc plugin to work. It works fine on android but while building with xcode building fails.
Steps to reproduce with fresh project (selected Angular framework when it was asked):
ionic start myApp blank --capacitor
cd myApp
ionic build
ionic capacitor add ios
npx cap open ios
It opens in xcode and i can build and run project on simulator just fine. Then i install phonegap-nfc plugin:
npm install phonegap-nfc
npm install #ionic-native/nfc
ionic cap sync
When i try to build again i receive semantic issue with cordovaplugins. There are 5 errors in NfcPlugin.m file saying 'new' is unavailable with note saying 'init has been explicitly marked unavailable here. How to fix this issue?
Some version info of my system:
Xcode version: 12.5 (12E262)
macOS version: Big Sur 11.3
node version: 16.0.0 (also tried with 10.16.0)
npm version: 7.10.0
Screenshot of xcode errors
I will answer my own question as i happened to find solution. I dont what is broken in xcode 12.5, but uninstalling xcode 12.5 and installing xcode 11.7 i was able to build succesfully and scan NFC tags.

visual studio cordova ios deploy for remote build

My problem is
Severity Code Description Project File Line Suppression State
Error Remote build error from the build server http://xxxxxx:3000/cordova - Derleme, Command to fetch XCode version failed. Your build may fail if the version installed is 8.0 or greater.
My Version:
Xcode version 7.2
Cordova version 6.3.1
Node 4.4.3
Npm 2.15
Cordova android 5.2.1
Cordova iOS 4.2.0
I had same issue previously, and I resolved it by go to my mac and accept the license agreement of xcode.
Run this in terminal : sudo xcodebuild -license and then type agree.

ionic build ios **export failed** error: exportArchive: Found no compatible export methds

When I run: ionic build ios the archive succeeds but the export fails.
Error Messages:
error: exportArchive: Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'
Error Domain=IDEFoundationErrorDomain Code=1 "Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'" UserInfo={NSLocalizedDescription=Found no compatible export methods for: DVTFilePath:0x7f9d3dc41d20:'/Users/**PATH**/platforms/ios/**PROJECTNAME**.xcarchive'}
Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,fasTask.xcarchive,-exportOptionsPlist,/Users/**PATH**/platforms/ios/exportOptions.plist,-exportPath,/Users/**PATH**/platforms/ios/build/device
I modified the exportOptions.plist 'method' key to 'export_method' but same error message.
I tried uninstalling Xcode and re-installing. The first build after re-installation gives me a successful build. Any builds after the first build give me the same error message as before.
Also if I npm uninstall -g ionic cordova and delete everything in the platform folder, then npm install -g ionic cordova then the first build succeeds but any build after it fails.
ionic serve works fine every-time.
Details:
Xcode 7.3.1
ionic 2.1.14
cordova 6.4.0
cordova-ios 4.3.1
ios-deploy 1.9.0
Thanks.
Hey I am having the same issue, it happened after updating ionic and cordova to the lastest version. I created a new project ionic start added platform ios and when trying ionic run ios --device i got the same output that you're having after building trying to export.
When running an older (pre-update) project i was not having any problem at all after i did a ionic platform rm ios and then ionic platform add ios the problem reproduced again. I think is has to be to the way that the updated cli is adding the platform or that it is expecting an updated SDK version (Xcode 8).
A workaround is first launch and installing the app to the device using Xcode, then in the terminal do ionic run ios --device -l this will create a livereload ionic server. At the end it will show the error but the livereload server will be still working and you can develop and the changes will be reflected on the app without any problem.
Xcode: 7.3.2
Ionic: 2.1.13
Cordova: 6.4
Try
ionic build ios --emulator

Build Commands Failed Error Code 65 Ionic (iOS)

I'm using ionic to build my iOS app but im having this problem when running the command : "ionic build ios"
** BUILD FAILED **
The following build commands failed:
CompileC build/HR\ APP.build/Debug-iphonesimulator/HR\ APP.build/Objects-normal/i386/PushPlugin.o HR\ APP/Plugins/com.phonegap.plugins.PushPlugin/PushPlugin.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/user/desktop/hr/platforms/ios/cordova/build-debug.xcconfig,-project,HR APP.xcodeproj,ARCHS=i386,-target,HR APP,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/user/desktop/hr/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/user/desktop/hr/platforms/ios/build/sharedpch
Try This command
phonegap plugin remove phonegap-plugin-push
I had this same issue,
I would like to let you know my machine local environment setup-
******************************************************
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: 5.0.8
OS: OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2 Build version 7C68
******************************************************
It generally occurs when we took app raw code form some other machine and try to build.
When I search for that I came to know that this issue is taking place due of spaces from build path
Steps I followed-
Opened app config.xml in editor.
Renamed App name such as-
<name>Rername App Title</name>
$ cordova plugin save
$ cordova platform rm ios
$ cordova platform add ios
After this I just build the app
$ ionic build ios
And that worked for me, hope you will get your issue resolved too.
This link helped me a lot-
https://forum.ionicframework.com/t/ionic-build-ios-fails-android-works/10515/2
Note:- Make sure you have complete icon and splash of the app for each platform i.e-
ionic resources

Unable to compile Phonegap app locally

I'm unable to compile my app for iOS locally, Android works OK.
I have installed both cordova and phonegap using npm install -g [...]. I am running OSX (10.7.5).
Version outputs from both:
$ cordova -v
5.1.1
$ phonegap -v
0.9.4
I have XCode installed (v 4.6.2). I also have the command-line tools installed.
Both the cordova and phonegap tools fail to build, seemingly for the same reason. Running phonegap build ios outputs:
$ phonegap build ios
phonegap detecting iOS SDK environment...
phonegap using the local environment
phonegap compiling iOS...
error ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'
Here is the output from the same cordova command:
$ cordova build ios
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/mike/apps/***/platforms/ios/__CLI__/config.xml
cp: no such file or directory: /Users/mike/apps/***/platforms/ios/platform_www/*
Parsing /Users/mike/apps/***/platforms/ios/__CLI__/config.xml failed
Error: ENOENT, no such file or directory '/Users/mike/apps/***/platforms/ios/__CLI__/config.xml'
at Error (native)
at Object.fs.openSync (fs.js:500:18)
at Object.fs.readFileSync (fs.js:352:15)
at Object.module.exports.parseElementtreeSync (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/util/xml-helpers.js:118:27)
at Object.ConfigParser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/configparser/ConfigParser.js:33:24)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:115:32
at Array.map (native)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/prepare.js:70:40
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)
It seems to me that there should be some replacement running on __CLI__ in the path that isn't happening, but it's difficult to tell. Below is a screenshot of the file structure this generates:
I am able to build using the remote build service, but it's quite laborious, as the app isn't properly loading so I need to do quite a bit of debugging to sort this out.
Node is installed at version 0.12.5. NPM is installed at version 2.11.2.
I have reinstalled the platform numerous times, and always get this error.
This question is a little old, but I'll throw a few things out there:
I've got a command line build of my ios platform running -- it does not have an __CLI__... subdirectory. Just a data point.
I'm wondering if there isn't something weird with the way Xcode is set up in relation to its build path. See this answer to make sure the output directory is set correctly: still getting <Cordova/CDVViewController.h> file not found error in xcode. I've got a desktop and mobile app set up in Xcode, and I have to remember to switch this setting back and forth.
PhoneGap / Cordova have been phasing out older versions of ios with their newer releases. It would not surprise me if cordova 5.1.1 did not support Xcode 4.6.2. You might want to try with an older release of the cordova library.

Resources