Ionic macOS build issue wtih Azure DevOps - ios

I'm trying to build Ionic based framework (Cordova plugin included) for iOS using Azure DevOps - Hosted macOS agent. I have included xcode in the Demands section.
Added Cordova build task and set the platform value to 'ios'
But getting 'Current working directory is not a Cordova-based project' error. Am I missing anything?
2018-11-07T19:49:07.6357620Z Module cache at /Users/vsts/.taco_home/node_modules
2018-11-07T19:49:08.4403560Z cordova already installed.
2018-11-07T19:49:08.4959970Z Adding support plugin.
2018-11-07T19:49:09.2854590Z { CordovaError: Current working directory is not a Cordova-based project.
2018-11-07T19:49:09.2855410Z at Object.cdProjectRoot (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:170:15)
2018-11-07T19:49:09.2856100Z at /Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/cordova-lib/src/cordova/plugin/index.js:36:40
2018-11-07T19:49:09.2856540Z at _fulfilled (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:854:54)
2018-11-07T19:49:09.2856690Z at self.promiseDispatch.done (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:883:30)
2018-11-07T19:49:09.2856810Z at Promise.promise.promiseDispatch (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:816:13)
2018-11-07T19:49:09.2858330Z at /Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:877:14
2018-11-07T19:49:09.2858660Z at runSingle (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:137:13)
2018-11-07T19:49:09.2858880Z at flush (/Users/vsts/.taco_home/node_modules/cordova/8.1.2/node_modules/cordova/node_modules/q/q.js:125:13)
2018-11-07T19:49:09.2859360Z at _combinedTickCallback (internal/process/next_tick.js:73:7)
2018-11-07T19:49:09.2859510Z at process._tickCallback (internal/process/next_tick.js:104:9)
2018-11-07T19:49:09.2860600Z name: 'CordovaError',
2018-11-07T19:49:09.2861150Z message: 'Current working directory is not a Cordova-based project.',
2018-11-07T19:49:09.2861220Z code: 0,
2018-11-07T19:49:09.2861360Z context: undefined }
2018-11-07T19:49:09.2972390Z ##[error]Task failed

Try adding the following instead of cordova build
npm install
Ionic command (Command: ionic cordova build ios)
Install an apple certificate
Install an apple provisioning profile
Xcode build
Publish to the app store (install from marketplace)

Related

Ionic build fails Info.plist not found

Apple has tricked me and even though I disabled autoupdates it now pulled the most recent XCode version (Version 10.0 (10A255)) and dependencies. The effect is that I can not build my app anymore, even after removing (ionic cordova platform remove ios) and re-adding the platform.
It now fails with the error below.
onic cordova run ios --debug --target="iPhone-8" --consolelogs
...
<path>/platforms/ios/build/emulator/MyApp.app/Info.plist file not found.
[ERROR] An error occurred while running cordova run ios --debug --target iPhone-8 (exit code 1).
ionic --version
3.20.0
---- EDIT
ran with verbose and received :No scripts found for hook "before_deploy". as additional info for the failure.
----- EDIT ------
Please look here for more detail. I was able to reproduce it from scratch / a blank app template
Blank app fails debug build - /Info.plist file not found
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
Try this command it should work,this is issue with cordova.
If you're building on the command-line, try this
ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"
or
Xcode 10
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
Xcode example
Now, You can also run this on command-line $ionic cordova build ios
Best of luck

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

Ionic building an IOS application

I have finished building and compiling the Android version of the application from my windows laptop.
But to run it on IOS, am I supposed to copy the application folder to a MAC computer and run "ionic run ios"?
Follow these steps.
Check whether Ionic is already installed in Mac by typing ionic -v.
If Ionic is already installed, type the following commands:
ionic platform add ios.
ionic build ios.
If Ionic is not installed yet,
First install Node.js in Mac.
Then install Cordova and Ionic by using this command:
npm install -g cordova ionic
Once done with the installation, use the above commands for adding platform and build.
Then you will able to see Xcode file in platform folder iOS.
Then you can ask iOS developer to generate ipa file for iOS build.
You should add ionic ios platform before build
ionic platform add ios
Read this link : Ionic build

IOS build fails for MFP Cordova-Ionic project

I am trying to build my MFP cordova Ionic based hybrid application created using CLI. It works perfect for android but it fails when I try to build it for iOS. There are multiple errors which I am facing
xcodebuild[14887:399060] [MT] PluginLoading: Required plug-in compatibility UUID 7FDF5C7A-131F-4ABB-9EDC-8C5F8F0B8A90 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
I tried resolving this issue by adding required missing key-val in plist file
When I try to run it from Xcode I am getting error - Some keys are missing in worklight.plist
After adding missing keys now I am getting
2016-05-04 17:50:28.507 StoreApp[14787:396490] [FATAL] [WL_INIT] -[WLImpl initWL] in WLImpl.m:180 :: Init failure: Can't read checksum.js, The operation couldn’t be completed. (Cocoa error 258.), (null). Reinstall the application and try again.
Even I have tried running simple MFP cordova project,but build fails for this
Even I have tried running simple MFP cordova project,but build fails for this
I cannot reproduce this...
idanadar#mbp-idan:~/Desktop$ mfp cordova create
? Enter name of app: myapp
? Enter the package ID: com.ibm.myapp
? Enter the app version: 1.0.0
? Select platforms to be supported by your app: ios
? The following plugins will be automatically added to your app:
cordova-plugin-mfp
org.apache.cordova.device
org.apache.cordova.dialogs
org.apache.cordova.geolocation
org.apache.cordova.globalization
org.apache.cordova.inappbrowser
org.apache.cordova.network-information
Please press enter to continue...
? Select additional plugins you would like to add:
? Enter a path to an app template to be added: cordova-hello-world-mfp
Embedded Cordova Command: cordova create "myapp" "com.ibm.myapp" "myapp" --copy-from="/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/cordovacmd/cordova/templates/cordova-hello-world-mfp"
Adding ios project...
Adding "cordova-plugin-mfp"
Installing "cordova-plugin-mfp" for ios
Installing "org.apache.cordova.device" for ios
Installing "org.apache.cordova.dialogs" for ios
Installing "org.apache.cordova.geolocation" for ios
Installing "org.apache.cordova.globalization" for ios
Installing "org.apache.cordova.inappbrowser" for ios
Installing "org.apache.cordova.network-information" for ios
Plugin install completed
If you made changes to your main.m file, please manually merge main.m.bak with MFP's main.m
Plugin "cordova-plugin-mfp" added successfully.
Preparing for push...
MFP App settings not found, configuring..
Embedded Cordova Command: cordova prepare ios
/Users/idanadar/Desktop/myapp/mobilefirst/com_ibm_myapp-iphone-1.0.0.wlapp has been built.
Push Completed Successfully.
MFP Cordova project created successfully.
idanadar#mbp-idan:~/Desktop$ cd myapp/
idanadar#mbp-idan:~/Desktop/myapp$ mfp cordova run --platform ios
The iOS Simulator then started and the application was displayed.
As for creating an Ionic-based app using MFP Cordova, I suggest that you will follow this: https://www.raymondcamden.com/2015/03/23/working-with-ibm-mobilefirst-and-the-ionic-framework/

PhoneGap CLI "cordova build ios" failed

i have created a new hello world project using the following command,
cordova create hello com.example.hello HelloWorld
the project is created successfully, then i add the ios platform by
cordova platform add ios
and to verify i have it added correctly, i type
cordova platform list
the iOS platform is shown in the list. so at this point, according to the PhoneGap tutorial, i can use the command
cordova build ios
to build the iOS version of the project. however, i encounter the following error:
Generating config.xml from defaults for platform "ios"
Preparing ios project
Compiling app on platform "ios" via command "/Users/Aldour/PhoneGap/hello/platforms/ios/cordova/build"
/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
throw e;
^
Error: An error occurred while building the ios project.
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:735:16)
at Socket.<anonymous> (child_process.js:948:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
the results that i have googled are mostly concerning the android version, talking about the invalid environment path setting. i dont know if it is related since i can create and build a PhoneGap project targeting the android platform without problem.
here is my $PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/node:/usr/local/bin/npm:/Developer/SDKs/android-sdk-macosx/platform-tools:/Developer/SDKs/android-sdk-macosx/tools
EDIT:
problem solved by re-installing xcode from app store
I had the same problem in Android platform, and it was solved with the commands:
cordova platform rm android
cordova platform add android
cordova build android
in Node.Js console. try it in ios.
If you get an error with 'cordova platform add android', you may need to manually remove any android folders in your project folder hierarchy.
This resolved my issue:
cordova platform remove ios
cordova platform add ios
cordova build ios
If you run the build with --verbose, you will probably see some permission issues. By default, XCode creates a folder of the build in ~/Developer, if you haven't changed it. There probably is a permissions issue when creating that folder. Just execute the following command: sudo cordova bulid ios
That should fix your issue.

Resources