APACHE CORDOVA device ready screen is coming in IOS device 🙄 🤔

build ios causing

An Error occurred trying to fall back to Cordova-lib execution: TypeError: Cannot read property ‘then’ of undefined
at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:296:21)
at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:162:19
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at nextTickCallbackWith0Args (node.js:433:9)
at process._tickCallback (node.js:362:13)
Error happened [TypeError: Cannot read property ‘then’ of undefined]
TypeError: Cannot read property ‘then’ of undefined
at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:296:21)
at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:162:19
at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at nextTickCallbackWith0Args (node.js:433:9)
at process._tickCallback (node.js:362:13)

Try uninstall ionic and then reinstalling it again. This has come up a few times and it always leads back to people using an older version of ionic, from a previous node version/installation.

:pray:t3:

Really, but I uninstall and install again means I will get the latest versions only. Right?

Ionic 2, you’ll need

npm install -g ionic@beta

###ionic build ios throwing follwoing exceptions:

An Error occurred trying to fall back to Cordova-lib execution: TypeError: Cannot read property 'then' of undefined
    at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:296:21)
    at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:162:19
    at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
    at nextTickCallbackWith0Args (node.js:433:9)
    at process._tickCallback (node.js:362:13)
Error happened [TypeError: Cannot read property 'then' of undefined]
TypeError: Cannot read property 'then' of undefined
    at Object.IonicTask.runCordova (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:296:21)
    at /usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:162:19
    at _fulfilled (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:557:44
    at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
    at nextTickCallbackWith0Args (node.js:433:9)
    at process._tickCallback (node.js:362:13)

Hi @mhartington ,

I have done lot more updates all over the plugins and I am able to run the project via xcode on my iPad. That means, as you told, device have the provision profile installed.

So now onwards I should be able to run the app directly, right? But when I try to run it using following command sudo ionic run ios --device am getting following error,

=== BUILD TARGET V2 Test OF PROJECT V2 Test WITH CONFIGURATION Debug ===

Check dependencies
Code Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “fob123” were found.

** BUILD FAILED **


The following build commands failed:
	Check dependencies
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Piccaza/ionic-projects/learning/fob/platforms/ios/cordova/build-debug.xcconfig,-project,V2 Test.xcodeproj,ARCHS=armv7 armv7s arm64,-target,V2 Test,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 armv7s arm64,CONFIGURATION_BUILD_DIR=/Users/Piccaza/ionic-projects/learning/fob/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/Piccaza/ionic-projects/learning/fob/platforms/ios/build/sharedpch
ERROR running one or more of the platforms: Error: /Users/Piccaza/ionic-projects/learning/fob/platforms/ios/cordova/run: Command failed with exit code 2

Where fob123 is the build identifier name I have provided in the Xcode. Please guide me to resolve the following issue:

Code Sign error: No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) matching the bundle identifier “fob123” were found.

@mhartington
Now how I am developing is, after each update in my code I will run the following code

sudo ionic run ios --device

This will throw some exception, I am just started avoiding them, then I have to xcode to load the app in iOS Device. For every single changes. Isn’t there a good way around?

You don’t need to use sudo in this case. You shouldn’t ever need sudo when running ionic commands, ever. :grin:

Again, this could be part of the problem. Ionic’s commands shouldn’t need sudo access since they’re just local to that directory.

You might need to run

sudo chown -R $(whoami) ~/path/to/your/project

In order to change the ownership over to you.

Again, and I cannot stress this enough…Never run any of the ionic commands with sudo. This just leads to more troubles :grin:

2 Likes