问题
I'm working with the "ExternalAccessory framework". I encountered a problem trying my app on a new iPad Air.
When i try to show the bluetooth picker this error appear:
CoreBluetooth[ERROR] Cancelling picker as we couldn't communicate with Bluetooth
The bluetooth is ON. Picker return this error:
Error Domain=EABluetoothAccessoryPickerErrorDomain Code=3 "The operation couldn’t be
completed.
My app work on every Apple Device, except the new iPad Air.
EDIT
I can connect and communicate with my device. The problem appear only if i call the bluetooth picker.
EDIT 2
the problem appears also with a modified version of EADemo.
I've added this function.
- (void)searchDevice {
[[EAAccessoryManager sharedAccessoryManager] showBluetoothAccessoryPickerWithNameFilter:nil completion:nil];
}
When i call it, BANG! The same error. Only in iPad Air
this problem will occur on all 64-bit devices
回答1:
Your app needs to include a 64-bit slice (add arm64
to the ARCHS
build setting), otherwise this problem will occur on 64-bit devices like iPhone 5S, iPad Air... This is a bug in iOS 7.0 - 7.0.3. It is supposed to be fixed in the next release.
回答2:
Adding both:
#import <CoreBluetooth/CoreBluetooth.h>
#import <ExternalAccessory/ExternalAccessory.h>
To either the header of implementation fixed this for me.
Very strange because the frameworks are already linked at app launch?..
来源:https://stackoverflow.com/questions/20402973/ipad-air-corebluetootherror-cancelling-picker-as-we-couldnt-communicate-wit