dkhaupt dkhaupt - 10 months ago 87
iOS Question

Ionic 3/Cordova: app runs via Ionic CLI but not through Xcode (build in Xcode succeeds)

I'm working on an Ionic 3 project which currently runs fine on a connected iOS device (with the

ionic cordova run ios --device
command), and builds both with the Ionic CLI and in Xcode.

However, when I attempt to run on my device through Xcode, it hangs on the startup screen and I see the below error(s) in the Xcode console. This behavior also occurs on the beta build I currently have on TestFlight- so I don't think it's restricted to my environment.

2017-08-11 10:42:15.996743-0400 MyApp[11551:3839240] libMobileGestalt MobileGestaltSupport.m:153: pid 11551 (MyApp) does not have sandbox access for <deviceID?> and IS NOT appropriately entitled
2017-08-11 10:42:15.996819-0400 MyApp[11551:3839240] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)


This error brings up a lot of results on Google and StackOverflow, but I haven't been able to find a resolution. There is a recent SO question with an answer specifically related to Ionic, but the step there (running npm install) didn't help

It seems to be related to plugins in the project & perhaps their permissions, however I want to be clear that I've setup the App ID on the Apple Developer site properly, enabled Push Services for both Dev and Distribution, and associated the App ID to a Dev Provisioning Profile and a Distribution Provisioning Profile.

I have this developer account associated to Xcode, and am signing the build with the account that has the App ID and other setup I just described. Push notifications (and everything else) work fine for me when running on my dev device.

My hunch is this is somehow related to the Push plugin I'm using in combination with a build/project option, but I do have the APS entitlement in my project config, as well as the Push Capability set to ON in the project.

The error message itself references an OpenRadar issue, but nothing on that page really helps. I took a look at my
Info.plist
file as one user mentioned, but I can't find any settings that might be related to this issue. There is an App Transport Security Settings dictionary with allowed domains, however I don't see how that'd be the issue because I can't even run on my dev device which is in the allowed domains.

I'm using Xcode 8.3.3 and attempting to build to a device on iOS 10.3. My Ionic info and
package.json
:

cli packages: (/Users/david/Source/sideline-app/node_modules)

@ionic/cli-plugin-cordova : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-utils : 1.7.0
ionic (Ionic CLI) : 3.7.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms : ios 4.4.0
Ionic Framework : ionic-angular 3.6.0

System:

Android SDK Tools : 25.2.5
Node : v7.4.0
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
ios-sim : 6.0.0
npm : 4.0.5


package.json

{
"name": "MyApp",
"version": "0.0.1",
"author": "AppAuthor",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.0",
"@angular/http": "4.1.0",
"@angular/platform-browser": "4.1.0",
"@angular/platform-browser-dynamic": "4.1.0",
"@angular/tsc-wrapped": "^4.3.4",
"@ionic-native/contacts": "^4.1.0",
"@ionic-native/core": "3.7.0",
"@ionic-native/facebook": "^4.1.0",
"@ionic-native/keyboard": "^4.1.0",
"@ionic-native/mixpanel": "^4.1.0",
"@ionic-native/push": "^4.1.0",
"@ionic-native/social-sharing": "^4.1.0",
"@ionic-native/splash-screen": "3.7.0",
"@ionic-native/status-bar": "3.7.0",
"@ionic/app-scripts": "^2.1.3",
"@ionic/storage": "^2.0.1",
"ajv": "^5.2.2",
"autoprefixer": "^7.1.2",
"chat-plugin": "file:onymos-plugin-chat",
"cordova-ios": "^4.4.0",
"cordova-plugin-compat": "^1.1.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-contacts": "^2.3.1",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-facebook4": "^1.9.1",
"cordova-plugin-mixpanel": "^3.1.0",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"cordova-plugin-x-socialsharing": "^5.1.8",
"cordova-sqlite-storage": "^2.0.4",
"es6-promise-plugin": "^4.1.0",
"ionic-angular": "^3.6.0",
"ionic-plugin-keyboard": "^2.2.1",
"ionic2-auto-complete": "^1.5.2-beta",
"ionicons": "3.0.0",
"ng2-validation": "^4.2.0",
"onymos-plugin-chat": "file:onymos-plugin-chat",
"phonegap-plugin-push": "^2.0.0",
"rxjs": "^5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "^0.8.12"
},
"devDependencies": {
"@angular/cli": "^1.2.7",
"@ionic/app-scripts": "1.3.7",
"@ionic/cli-plugin-cordova": "1.6.2",
"@ionic/cli-plugin-ionic-angular": "1.4.1",
"ionic": "3.7.0",
"typescript": "2.2.1"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-sqlite-storage": {},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-contacts": {
"CONTACTS_USAGE_DESCRIPTION": " "
},
"cordova-plugin-facebook4": {
"APP_ID": <FB app ID>,
"APP_NAME": "MyApp"
},
"cordova-plugin-mixpanel": {},
"phonegap-plugin-push": {},
"onymos-plugin-chat": {}
},
"platforms": [
"ios"
]
}
}


UPDATE

After removing the iOS platform from my project (for another reason) and re-adding it, I no longer see the hanging behavior on the startup screen. I still see the error in the console output- however it doesn't appear that it was the cause of the hanging I was observing. My guess is that removing and re-adding the iOS platform reset something related to one of my plugins.

Answer Source

Posting my update as an answer for closure, in case anyone else hits this:

After removing the iOS platform from my project (for another reason) and re-adding it, I no longer see the hanging behavior on the startup screen. I still see the error in the console output- however it doesn't appear that it was the cause of the hanging I was observing. My guess is that removing and re-adding the iOS platform reset something related to one of my plugins.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download