flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Minimum iOS Deployment target is 10.0

Open trueb2 opened this issue 4 years ago • 1 comments

Some of the CoreBluetooth bindings are minimum of 10.0 for IPHONEOS_DEPLOYMENT_TARGET. The Android minimum sdk version is documented on the README. The default for a new flutter application is 9.0.

Instructions for updating the deployment target are documented here: https://docs.flutter.dev/deployment/ios#review-xcode-project-settings

Example Errors:

    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:553:49: warning: 'CBManagerState' is only available on iOS 10.0 or newer [-Wunguarded-availability]
    - (ProtosBluetoothState*)toBluetoothStateProto:(CBManagerState)state {
                                                    ^
    In module 'CoreBluetooth' imported from /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.h:10:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBManager.h:32:28: note: 'CBManagerState' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    typedef NS_ENUM(NSInteger, CBManagerState) {
                               ^
    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:553:1: note: annotate 'toBluetoothStateProto:' with an availability attribute to silence this warning
    - (ProtosBluetoothState*)toBluetoothStateProto:(CBManagerState)state {
    ^
                                                                          API_AVAILABLE(ios(10.0))
    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:113:53: warning: values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat]
        NSLog(@"getConnectedDevices periphs size: %lu", [periphs count]);
                                                  ~~~   ^~~~~~~~~~~~~~~
                                                  %lu   (unsigned long)
    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:78:37: warning: 'CBManagerStateUnsupported' is only available on iOS 10.0 or newer [-Wunguarded-availability]
        if(self.centralManager.state != CBManagerStateUnsupported && self.centralManager.state != CBManagerStateUnknown) {
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    In module 'CoreBluetooth' imported from /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.h:10:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBManager.h:32:28: note: 'CBManagerState' has been marked as being introduced in iOS 10.0 here, but the deployment target is iOS 9.0.0
    typedef NS_ENUM(NSInteger, CBManagerState) {
                               ^
    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:78:37: note: enclose 'CBManagerStateUnsupported' in an @available check to silence this warning
        if(self.centralManager.state != CBManagerStateUnsupported && self.centralManager.state != CBManagerStateUnknown) {
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/username/.pub-cache/git/flutter_blue-a7fa5410b66cabdc3f12e7d74375db3477a70c85/ios/Classes/FlutterBluePlugin.m:78:95: warning: 'CBManagerStateUnknown' is only available on iOS 10.0 or newer [-Wunguarded-availability]
        if(self.centralManager.state != CBManagerStateUnsupported && self.centralManager.state != CBManagerStateUnknown) {
                                                                                                  ^~~~~~~~~~~~~~~~~~~~~

trueb2 avatar Dec 02 '21 23:12 trueb2

Setting the target deployment version needs to be done via Flutter/AppFrameworkInfo.plist; otherwise, it will be blown away by a clean build.

https://stackoverflow.com/questions/63973136/the-ios-deployment-target-iphoneos-deployment-target-is-set-to-8-0-in-flutter

trueb2 avatar Dec 03 '21 17:12 trueb2