iOS 使用 Microsoft Band 构建错误
iOS using microsoft band build error
我创建了项目,导入了microsoft band sdk
http://developer.microsoftband.com/download/Microsoft%20Band%20SDK%20for%20iOS.zip
我试过亲密的 sdk 传感器样本
http://developer.microsoftband.com/download/Microsoft%20Band%20SDK%20and%20Samples%20for%20iOS.zip
我的viewcontroller.h:
#import <UIKit/UIKit.h>
#import <MicrosoftBandKit_iOS/MicrosoftBandKit_iOS.h>
@interface ViewController : UIViewController<MSBClientManagerDelegate>
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *ConnectionIndicator;
.
.
.
other UI components
.
.
.
@end
我的viewcontroller.m:
#import "ViewController.h"
@interface ViewController ()
@property (weak,nonatomic)MSBClient *client;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[MSBClientManager sharedManager].delegate = self;
_client = [[[MSBClientManager sharedManager] attachedClients]firstObject];
if ( _client == nil ) {
NSLog(@"Band connected failed: No Band paired");
return;
}else{
[[MSBClientManager sharedManager] connectClient:_client];
NSLog(@"Trying to connect to Band...");
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)clientManager:(MSBClientManager *)clientManager clientDidConnect:(MSBClient *)client{
}
-(void)clientManager:(MSBClientManager *)clientManager clientDidDisconnect:(MSBClient *)client{
}
-(void)clientManager:(MSBClientManager *)clientManager client:(MSBClient *)client didFailToConnectWithError:(NSError *)error{
}
@end
警告:
Ld DerivedData/SenseWatch/Build/Products/Debug-iphoneos/SenseWatch.app/SenseWatch normal arm64
cd /Users/Jieyi/Documents/Repo/SenseWatch
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos -F/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos -F/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1 -filelist /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphoneos/SenseWatch.build/Objects-normal/arm64/SenseWatch.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework MicrosoftBandKit_iOS -Xlinker -dependency_info -Xlinker /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphoneos/SenseWatch.build/Objects-normal/arm64/SenseWatch_dependency_info.dat -o /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos/SenseWatch.app/SenseWatch
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBClientManager.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBBLEProvider.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBClient.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBDeviceManager.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
...
错误:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CBUUID", referenced from:
objc-class-ref in MicrosoftBandKit_iOS(MSBBLEProvider.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBSpple.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBPeripheral.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBSensorManagerUtility.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyPushV2.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyCargo.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyCargoV2.o)
...
"_CBCentralManagerOptionShowPowerAlertKey", referenced from:
+[MSBBLEProvider buildCBCentralManagerOptions] in MicrosoftBandKit_iOS(MSBBLEProvider.o)
"_OBJC_CLASS_$_CBCentralManager", referenced from:
objc-class-ref in MicrosoftBandKit_iOS(MSBBLEProvider.o)
"_CBCentralManagerOptionRestoreIdentifierKey", referenced from:
+[MSBBLEProvider buildCBCentralManagerOptions] in MicrosoftBandKit_iOS(MSBBLEProvider.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我对 Xcode 和 objective-c
还很陌生
我不知道这是什么。
您缺少 CoreBuetooth 框架。在 link with libraries 部分下包含框架。
我创建了项目,导入了microsoft band sdk http://developer.microsoftband.com/download/Microsoft%20Band%20SDK%20for%20iOS.zip 我试过亲密的 sdk 传感器样本 http://developer.microsoftband.com/download/Microsoft%20Band%20SDK%20and%20Samples%20for%20iOS.zip
我的viewcontroller.h:
#import <UIKit/UIKit.h>
#import <MicrosoftBandKit_iOS/MicrosoftBandKit_iOS.h>
@interface ViewController : UIViewController<MSBClientManagerDelegate>
@property (strong, nonatomic) IBOutlet UIActivityIndicatorView *ConnectionIndicator;
.
.
.
other UI components
.
.
.
@end
我的viewcontroller.m:
#import "ViewController.h"
@interface ViewController ()
@property (weak,nonatomic)MSBClient *client;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[MSBClientManager sharedManager].delegate = self;
_client = [[[MSBClientManager sharedManager] attachedClients]firstObject];
if ( _client == nil ) {
NSLog(@"Band connected failed: No Band paired");
return;
}else{
[[MSBClientManager sharedManager] connectClient:_client];
NSLog(@"Trying to connect to Band...");
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)clientManager:(MSBClientManager *)clientManager clientDidConnect:(MSBClient *)client{
}
-(void)clientManager:(MSBClientManager *)clientManager clientDidDisconnect:(MSBClient *)client{
}
-(void)clientManager:(MSBClientManager *)clientManager client:(MSBClient *)client didFailToConnectWithError:(NSError *)error{
}
@end
警告:
Ld DerivedData/SenseWatch/Build/Products/Debug-iphoneos/SenseWatch.app/SenseWatch normal arm64
cd /Users/Jieyi/Documents/Repo/SenseWatch
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -L/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos -F/Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos -F/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1 -filelist /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphoneos/SenseWatch.build/Objects-normal/arm64/SenseWatch.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework MicrosoftBandKit_iOS -Xlinker -dependency_info -Xlinker /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Intermediates/SenseWatch.build/Debug-iphoneos/SenseWatch.build/Objects-normal/arm64/SenseWatch_dependency_info.dat -o /Users/Jieyi/Documents/Repo/SenseWatch/DerivedData/SenseWatch/Build/Products/Debug-iphoneos/SenseWatch.app/SenseWatch
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBClientManager.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBBLEProvider.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBClient.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
ld: warning: URGENT: all bitcode will be dropped because '/Users/Jieyi/Downloads/MicrosoftBandKit_iOS_SAMPLES_1.3.10427.1/MicrosoftBandKit_iOS.framework/MicrosoftBandKit_iOS(MSBDeviceManager.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.
...
错误:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CBUUID", referenced from:
objc-class-ref in MicrosoftBandKit_iOS(MSBBLEProvider.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBSpple.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBPeripheral.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBSensorManagerUtility.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyPushV2.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyCargo.o)
objc-class-ref in MicrosoftBandKit_iOS(MSBZippyCargoV2.o)
...
"_CBCentralManagerOptionShowPowerAlertKey", referenced from:
+[MSBBLEProvider buildCBCentralManagerOptions] in MicrosoftBandKit_iOS(MSBBLEProvider.o)
"_OBJC_CLASS_$_CBCentralManager", referenced from:
objc-class-ref in MicrosoftBandKit_iOS(MSBBLEProvider.o)
"_CBCentralManagerOptionRestoreIdentifierKey", referenced from:
+[MSBBLEProvider buildCBCentralManagerOptions] in MicrosoftBandKit_iOS(MSBBLEProvider.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我对 Xcode 和 objective-c
还很陌生我不知道这是什么。
您缺少 CoreBuetooth 框架。在 link with libraries 部分下包含框架。