iBeacon crashing app ios


#1

Hello there!

I’ve installed the iBeacon native plugin and my app on iOS is just crashing once the splashscreen is closed.

Ionic Info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.9.2
    ionic (Ionic CLI) : 3.9.2

global packages:

    Cordova CLI : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : android 6.3.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.2
    Node       : v8.4.0
    npm        : 5.5.1
    OS         : macOS Sierra
    Xcode      : Xcode 9.1 Build version 9B55

package.json:

"dependencies": {
    "@angular/common": "5.0.0",
    "@angular/compiler": "5.0.0",
    "@angular/compiler-cli": "5.0.0",
    "@angular/core": "5.0.0",
    "@angular/forms": "5.0.0",
    "@angular/http": "5.0.0",
    "@angular/platform-browser": "5.0.0",
    "@angular/platform-browser-dynamic": "5.0.0",
    "@ionic-native/core": "4.3.2",
    "@ionic-native/ibeacon": "^4.4.2",
    "@ionic-native/splash-screen": "4.3.2",
    "@ionic-native/status-bar": "4.3.2",
    "@ionic/storage": "2.1.3",
    "cordova-android": "^6.3.0",
    "cordova-ios": "^4.5.4",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-ibeacon": "^3.5.2",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.3.0",
    "cordova-plugin-whitelist": "^1.3.1",
    "ionic-angular": "3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18",
    "com.unarin.cordova.beacon": "~3.5.2"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.0",
    "typescript": "2.4.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "ionic-plugin-keyboard": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-statusbar": {},
      "com.unarin.cordova.beacon": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  }

Does anyone have an ideia of what could it be?

Cheers.


#2

Maybe because your core version is behind on your specific plugin? In any case, did you already try to debug it through xcode and check the logs there when running?


#3

Can you please explain me this?

I’m not used to work with xcode but I’ll do it right away.


#4
"@ionic-native/core": "4.3.2",

tells me you’re core package for ionic native is fixed at 4.3.2.

"@ionic-native/ibeacon": "^4.4.2",

Tells me this specific package is installed from a higher version. Usually I tend to keep the core package as up-to-date as it’s plugins.

Regarding Xcode: run your app through xcode and look inside the terminal from xcode. It will show you the plugin debug information over there.


#5

New package.json:

"dependencies": {
    "@angular/common": "5.0.0",
    "@angular/compiler": "5.0.0",
    "@angular/compiler-cli": "5.0.0",
    "@angular/core": "5.0.0",
    "@angular/forms": "5.0.0",
    "@angular/http": "5.0.0",
    "@angular/platform-browser": "5.0.0",
    "@angular/platform-browser-dynamic": "5.0.0",
    "@ionic-native/core": "4.4.2",
    "@ionic-native/ibeacon": "4.4.2",
    "@ionic-native/splash-screen": "4.4.2",
    "@ionic-native/status-bar": "4.4.2",
    "@ionic/storage": "2.1.3",
    "com.unarin.cordova.beacon": "~3.5.2",
    "cordova-android": "^6.3.0",
    "cordova-ios": "^4.5.4",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-ibeacon": "^3.5.2",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.3.0",
    "cordova-plugin-whitelist": "^1.3.1",
    "ionic-angular": "3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.0",
    "typescript": "2.4.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "ionic-plugin-keyboard": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-statusbar": {},
      "com.unarin.cordova.beacon": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  }

So, this happened…

2017-11-23 11:07:01.194849+0000 Project[533:95571] *** Assertion failure in -[CLLocationManager setAllowsBackgroundLocationUpdates:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreLocationFramework/CoreLocation-2101.0.63/Framework/CoreLocation/CLLocationManager.m:649
2017-11-23 11:07:01.195468+0000 Project[533:95571] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: !stayUp || CLClientIsBackgroundable(internal->fClient)'
*** First throw call stack:
(0x1b9ebb3d 0x1ac73067 0x1b9eba19 0x1c2e152d 0x22a9c04f 0x4889d 0x4860b 0x84775 0x84b97 0x88d57 0x91b9d 0x583ed 0x5823f 0x59b27 0x23ec7d63 0x23e7014b 0x23e71b67 0x23e71aaf 0x23e71a25 0x23d0207b 0x23e54b41 0x23cd552d 0x23cd7521 0x1f854c5b 0x1f854e0f 0x1b9a7fdd 0x1b9a7b05 0x1b9a5f51 0x1b8f91af 0x1b8f8fd1 0x1d0a3b41 0x20c81a53 0x480fb 0x1b0e64eb)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Still have no clue why it is crashing my app :confused:

Update: Managed to get it working by going to my application -> Capabilities -> Background Modes