CBCentralManager causes signal 11

39 views
Skip to first unread message

Sunil Patel

unread,
Mar 6, 2016, 5:05:43 PM3/6/16
to RoboVM

Hello

I'm creating a CBCentralManager to listen for changes to bluetooth state.

CBCentralManager bluetoothManager = new CBCentralManager(new CBCentralManagerDelegateAdapter() {
@Override
public void didUpdateState(CBCentralManager central) {
super.didUpdateState(central);
}
}, DispatchQueue.create("bluetoothStateManager", null));

I've tried with a private dispatch queue (as above) and with the main dispatch queue (using DispatchQueue.getMainQueue()).

When the app is running on my phone, I:
  1. open control centre
  2. toggle bluetooth mode
  3. close control centre
  4. goto step 1
After a variable number of attempts (estimating, I'd say between 1 and 10) the app crashes.

On the console I get the following error:

06/03/16 21:46:25: [ERROR] AppLauncher failed with an exception:
06/03/16 21:46:25: [ERROR] java.lang.RuntimeException: The app crashed: Terminated due to signal 11. Check the device logs in Xcode (Window->Devices) for more info.
06/03/16 21:46:25: [ERROR] at org.robovm.libimobiledevice.util.AppLauncher.pipeStdOut(AppLauncher.java:829)
06/03/16 21:46:25: [ERROR] at org.robovm.libimobiledevice.util.AppLauncher.launchInternal(AppLauncher.java:734)
06/03/16 21:46:25: [ERROR] at org.robovm.libimobiledevice.util.AppLauncher.launch(AppLauncher.java:1052)
06/03/16 21:46:25: [ERROR] at org.robovm.compiler.target.ios.AppLauncherProcess$1.run(AppLauncherProcess.java:67)

I've attached the above-mentioned xcode device logs, but am struggling to see why the crash is occuring.

Is anyone able to shed some light?

Many thanks, sunil.
IOSLauncher 06-03-2016, 20-58.crash

Niklas Therning

unread,
Mar 8, 2016, 12:52:52 PM3/8/16
to Sunil Patel, RoboVM
I'm afraid we will need a complete test app to be able to help you debug this issue.

--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sunil Patel

unread,
Mar 8, 2016, 3:03:36 PM3/8/16
to RoboVM, the.one.d...@gmail.com
Thanks for the reply Niklas, I created a plain RoboVM app (not without libgdx) with the intention of sharing it here, but of course it doesn't crash :)
I guess this is one for me to investigate myself, therefore.

Sunil Patel

unread,
Mar 13, 2016, 9:27:08 AM3/13/16
to RoboVM
Just in case anyone comes across anything similar - the solution is to run through Xcode zombie analysis.

The CBCentralManagerDelegate was getting garbage collected, so to fix this issue you need to maintain a reference to it.

CBCentralManager bluetoothManager = new CBCentralManager(new CBCentralManagerDelegateAdapter() {
@Override
public void didUpdateState(CBCentralManager central) {
super.didUpdateState(central);
}
}, DispatchQueue.create("bluetoothStateManager"null));

becomes

CBCentralManagerDelegate delegate = new CBCentralManagerDelegateAdapter() {
@Override
public void didUpdateState(CBCentralManager central) {
super.didUpdateState(central);
}
};
CBCentralManager bluetoothManager = new CBCentralManager(delegate, DispatchQueue.create("bluetoothStateManager"null));
Reply all
Reply to author
Forward
0 new messages