Problems during connection

edited September 2018 in iOS

Hi guys,

I have a strange problem with connection to MetaMotionC board from ios using SDK 2.10.0

Scenario: When the app starts, it look for metamotion devices on BT, and tries to connect to the board.
After connection, the app starts streaming various data from board (eulerAngles, stepDetection, Accelerometer).

Everything is ok during the first run of the application, so i kill the application and i restart it for a second run.
During the second run everything is ok, so i repeat the application killing for restarting in a third run.

When the application tries to connect to the board in the third run, the app crashes, and i can see the following error from xCode:

2018-09-20 18:52:37.917582+0200 App[710:61398] *** Assertion failure in -[MBLBitmaskEvent deactivateAsync], /Users/user/workspace/AppMobile/platforms/ios/Pods/MetaWearPrivate/MetaWear/Classes/Core/MBLRegister.m:566
2018-09-20 18:52:37.918502+0200 App[710:61398] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'activate/deactivate calls unbalanced.'
*** First throw call stack:
(0x1d237b3d 0x1c4bf067 0x1d237a19 0x1db2d52d 0x4c7913 0x435ce7 0x227813 0x1320467 0x132c66f 0x1323a39 0x132e76b 0x132e471 0x1caba87d 0x1caba45c)
libc++abi.dylib: terminating with uncaught exception of type NSException

This error appear during all the next run of the application. If i pull and re-insert the battery from metaboard, the app stop crashing and works ok, but after other 2 restart of the app, this problem re-appear.

This problem is very strange, because i developed the same algorithm on an android app, without any problem.

What can be the cause of that crash?

Thanks a lot

Comments

  • Are you ever stopping the sensors or are you just letting everything continue running when you kill the app?

  • @Eric said:
    Are you ever stopping the sensors or are you just letting everything continue running when you kill the app?

    Hi Eric,
    Thanks for your quick reply.
    Sensors are always in running when i kill the app, both in Android and in iOS.
    It can be a problem for iOS version?

  • You should stop the sensors before terminating the app.

    You can try iOS SDK v3 to see if the problem occurs.

This discussion has been closed.