With today's update to 5.1.0+2, all of our iOS builds are failing.
Xcode's output:
↳
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:40:81: error: use of undeclared identifier 'PHAccessLevelAddOnly'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:40:102: error: use of undeclared identifier 'PHAccessLevelReadWrite'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:53:89: error: use of undeclared identifier 'PHAccessLevelAddOnly'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:53:110: error: use of undeclared identifier 'PHAccessLevelReadWrite'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:71:14: error: use of undeclared identifier 'PHAuthorizationStatusLimited'; did you mean 'PHAuthorizationStatusDenied'?
case PHAuthorizationStatusLimited:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
PHAuthorizationStatusDenied
In module 'Photos' imported from /Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h:22:5: note: 'PHAuthorizationStatusDenied' declared here
PHAuthorizationStatusDenied, // User has explicitly denied this application access to photos data.
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:71:14: error: duplicate case value 'PHAuthorizationStatusDenied'
case PHAuthorizationStatusLimited:
^
/Users/vagrant/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:67:14: note: previous case defined here
case PHAuthorizationStatusDenied:
^
6 errors generated.
App should build
Note that we are using Bitrise CI/CD for consistent builds. This error occurs in every build we attempt.
This is a pretty large app, so lots of variables here, not sure what is needed - let me know.
pubspec.yaml is looking for:
permission_handler: ^5.0.0+hotfix.6
Podfile includes:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.calendar
'PERMISSION_EVENTS=0',
## dart: PermissionGroup.reminders
'PERMISSION_REMINDERS=0',
## dart: PermissionGroup.contacts
'PERMISSION_CONTACTS=0',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=0',
## dart: PermissionGroup.speech
'PERMISSION_SPEECH_RECOGNIZER=0',
## dart: PermissionGroup.mediaLibrary
'PERMISSION_MEDIA_LIBRARY=0',
## dart: PermissionGroup.sensors
'PERMISSION_SENSORS=0'
]
end
flutter_additional_ios_build_settings(target)
end
end
Version:
permission_handler: 5.1.0+2
flutter: 1.22.4
Platform:
Sorry to hear about this, I will look into this tomorrow. Looks like something todo with compiling against iOS 13.5 which doesn't know about the new limited status.
Oh, sorry - that would probably be helpful, too - it's using Xcode 11.5
The quick workaround that we just tested was to pull off the caret and lock it down to the known building version, so no rush for us.
Any word on when this will be fixed or a manual fix for now?
Same issue here. Any workaround?
Same here.
I am having the same issues too
Same here.
:( same here, please fix it
Hey y'all. I'm facing the same too. Any help please?
I am looking into this, question is everybody using Xcode 11.x?
Can you upgrade to latest Xcode and if not why (so that I can get a good idea how to solve this issue)?
Just ran into this thread to find a solution to this issue, but to answer, I'm on a device that builds apps on Xcode 11 just fine still on Catalina and no longer supported by Big Sur which is needed for Xcode 12.
@lrorpilla thank you for your reply. The problem here is a bit that we merged a pull request which added the new iOS Photo permission (PHAuthorizationStatusLimited) which is only compatible with iOS 14+.
This means you will have to compile with Xcode 12 which can still be installed on macOS Catalina 10.15.4 (see requirements overview here). I am a bit in conflict here, there are people really requesting this new permissions feature, while on the other hand developers are having issues with this since they are not ready to work with Xcode 12 yet.
At the moment I am thinking you can do one of the following two things:
Thanks for your time @mvanbeusekom , the thing is i downgraded to 5.0.1+1 which has a mismatch with permission constants between Dart and Android code bug that was fixed in the latest version, is there another stable version that we can use for now?
@mostafaAbdelazim sorry yes that is indeed a problem, you can work around this by using a dependency override on the permission_handler_platform_interface: 2.0.1:
dependencies:
...
permission_handler: 5.0.1+1
dependency_overrides:
permission_handler_platform_interface: 2.0.1
I will make a special hotfix for this today pinning the correct version. Meaning I will make a permission_handler: 5.0.1+2 which ensures it will use the correct version of the permission_handler_platform_interface.
@mostafaAbdelazim the hotfix version is released, so if you simply pin the dependency on version permission_handler: 5.0.1+2 there should be no need to use any dependency overrides.
Working fine now on 5.0.1+2, Thanks a lot
Still the same issue
Here is the error stack
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:40:81: error: use of undeclared identifier 'PHAccessLevelAddOnly'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:40:102: error: use of undeclared identifier 'PHAccessLevelReadWrite'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:53:89: error: use of undeclared identifier 'PHAccessLevelAddOnly'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:53:110: error: use of undeclared identifier 'PHAccessLevelReadWrite'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:71:14: error: use of undeclared identifier 'PHAuthorizationStatusLimited'; did you mean 'PHAuthorizationStatusDenied'?
case PHAuthorizationStatusLimited:
^~~~~~~~
PHAuthorizationStatusDenied
In module 'Photos' imported from /Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.6.sdk/System/Library/Frameworks/Photos.framework/Headers/PHPhotoLibrary.h:22:5: note: 'PHAuthorizationStatusDenied' declared here
PHAuthorizationStatusDenied, // User has explicitly denied this application access to photos data.
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:71:14: error: duplicate case value 'PHAuthorizationStatusDenied'
case PHAuthorizationStatusLimited:
^
/Users/onyii/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrategy.m:67:14: note: previous case defined here
case PHAuthorizationStatusDenied:
@goodluck11
Had you clean your project?
flutter clean
I tested it yesterday and it works fine. Be sure that you request the exact version in your pubspec.yaml
permission_handler: 5.0.1+2
I just installed Xcode 12.0.1, The errors are gone, App is installed successfully, and working fine
Any solution on this having same error!!
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/devtech/Desktop/fluttersdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrateg
y.m:40:81: error: use of undeclared identifier 'PHAccessLevelAddOnly'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite
handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/devtech/Desktop/fluttersdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrateg
y.m:40:102: error: use of undeclared identifier 'PHAccessLevelReadWrite'
[PHPhotoLibrary requestAuthorizationForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite
handler:^(PHAuthorizationStatus authorizationStatus) {
^
/Users/devtech/Desktop/fluttersdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrateg
y.m:53:89: error: use of undeclared identifier 'PHAccessLevelAddOnly'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
^
/Users/devtech/Desktop/fluttersdk/.pub-cache/hosted/pub.dartlang.org/permission_handler-5.1.0+2/ios/Classes/strategies/PhotoPermissionStrateg
y.m:53:110: error: use of undeclared identifier 'PHAccessLevelReadWrite'
status = [PHPhotoLibrary authorizationStatusForAccessLevel:(addOnlyAccessLevel)?PHAccessLevelAddOnly:PHAccessLevelReadWrite];
@urvashikharecha please update Xcode to version 12.x or pin your dependency on permission_handler: 5.0.1+2 (don't use a caret). See details in this comment.
I will close this issue now, if you have tried the above and still experience issues feel free to leave a comment.
I updated the package permission_handler to 5.0.1+2 but i continue with this issue
I updated the package permission_handler to 5.0.1+2 but i continue with this issue
Excuse. after running the pod install command again it worked
我也遇到这个问题,卡了2天,最后是升级电脑系统到最新,升级xcode到最新,完美解决问题。除此之外,没有别的方法。
comment
permission_handler 5.0.1+2 which doesn't match any versions,it is removed?
comment
permission_handler 5.0.1+2 which doesn't match any versions,it is removed?
Not sure if you have a question or if you are replying to someone. If you have a question can you explain a bit more detailed?
comment
permission_handler 5.0.1+2 which doesn't match any versions,it is removed?
Not sure if you have a question or if you are replying to someone. If you have a question can you explain a bit more detailed?
i add "permission_handler: 5.0.1+2" to my pubspec.yaml,then exec "flutter pub get" reproduce a error:
Because ones_mobile depends on permission_handler 5.0.1+2 which doesn't match any versions, version solving failed.
Running "flutter pub get" in ones_mobile...
pub get failed (1; Because ones_mobile depends on permission_handler 5.0.1+2
which doesn't match any versions, version solving failed.)
@lyf571321556 sorry I cannot reproduce this error. Version 5.0.1+2 is freely available (see here).
I have quickly created a test project and used the following steps:
flutter create test_projecttest_project folder: cd test_projectpermission_handler: 5.0.1+2 to pubspec.yaml: vim pubspec.yaml (see final contents below)vim) and download dependencies: flutter pub get
Contents of
pubspec.yaml
name: test_project
description: A new Flutter project.
publish_to: 'none'
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
permission_handler: 5.0.1+2
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
Output of
flutter pub get
$ flutter pub get
Running "flutter pub get" in test_project... 1,212ms
@lyf571321556 sorry I cannot reproduce this error. Version 5.0.1+2 is freely available (see here).
I have quickly created a test project and used the following steps:
- Create test project:
flutter create test_project- Change into the new
test_projectfolder:cd test_project- Add
permission_handler: 5.0.1+2topubspec.yaml:vim pubspec.yaml(see final contents below)- Exit editor (in my case
vim) and download dependencies:flutter pub getContents of
pubspec.yamlname: test_project description: A new Flutter project. publish_to: 'none' version: 1.0.0+1 environment: sdk: ">=2.7.0 <3.0.0" dependencies: flutter: sdk: flutter permission_handler: 5.0.1+2 cupertino_icons: ^1.0.2 dev_dependencies: flutter_test: sdk: flutter flutter: uses-material-design: trueOutput of
flutter pub get$ flutter pub get Running "flutter pub get" in test_project... 1,212ms
solve this issue by useing permission_handler: <=5.0.1+2,in fact it works on Version 5.0.1+1.
@lyf571321556, this will bring the original problem back when trying to compile on any Xcode before 12. So if you are running Xcode 12 or later no problem go ahead (even better, use version 5.1.0+2, note that here the minor number equals 1 and not the patch number).
If you do compile on pre-Xcode 12 (this could also be your CI/CD server), you will have to use version 5.0.1+2 to not run into issues.
@lyf571321556, this will bring the original problem back when trying to compile on any Xcode before 12. So if you are running Xcode 12 or later no problem go ahead (even better, use version
5.1.0+2, note that here the minor number equals 1 and not the patch number).If you do compile on pre-Xcode 12 (this could also be your CI/CD server), you will have to use version
5.0.1+2to not run into issues.
got it,Thanks
The same problem with version permission_handler: ^5.0.1+1 in xcode 11.7, catalina 10.15.7
solved by run pod install under the ios folder of the app project, then compile in xcode to be Build Succeded.
wouldn't know what happen at the next compling, just try more cases.
I'm on a critical stage of the project I'm currently working on and there are many developers related and we can't afford to work on CI/CD server changes/trials these days. So we are stick to iOS dev environments we currently have and do not want to go for updates/upgrades.
Hence my environment is as follows:
Above Error came up and fixed it by downgrading the package version to ^5.1.0+2 to 5.0.1+2.
I would still need to assess the impact of this and also functionality but other than that the, iOS build issue has gone!
😇 🙏 ❤️
@randikachan at the moment the only difference is that version 5.1.0+2 contains support for the iOS PERMISSION_PHOTOS permission. This is a new feature in iOS 14+ and therefore requires Xcode 12 and higher.
There is no other difference between the two versions you mentioned. Since you and your team decided to pin the environment to Xcode 11.2.1 you are not (yet) interested in new iOS 14+ features and therefore pinning the permission_handler to 5.0.1+2 doesn't have any impact on your App for now.
Of course new development on the permission_handler will continue on the new set of requirements meaning that this might change in the future (i.e. we are currently in the process of adding null safety support, which will only be available based on the 5.1.0+2 version).
Thanks a lot for the detailed insights of the different package versions @mvanbeusekom Maurits!
I will keep these documented for the team for sure!
Package is really helpful!
I think we should improve the documentation regarding this rather than keeping these information within the GitHub issues.
Please let me know if I can help/support!
Cheers!
<key>NSPhotoLibraryUsageDescription</key>
<string>YOUR DESC</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>YOUR DESC</string>
Make sure that you have 2 permissions for read and write iOS device on Info.plist file
Hi @mvanbeusekom ,
After updating app with 7.1.0, build is failing with below error. NSPhotoLibraryUsageDescription and NSPhotoLibraryAddUsageDescription already exist in info.plist.
mac os version : 10.15.7.
xcode version: 12.5
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/PermissionManager.m:75:59: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
^~~
openURL:options:completionHandler:
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
- (BOOL)openURL:(NSURL)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
^
1 warning generated.
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:48:7: warning: 'UIUserNotificationType' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
UIUserNotificationType notificationTypes = 0;
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:17:32: note: 'UIUserNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIUserNotificationType) {
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:49:28: warning: 'UIUserNotificationTypeSound' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
notificationTypes |= UIUserNotificationTypeSound;
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:17:32: note: 'UIUserNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIUserNotificationType) {
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:50:28: warning: 'UIUserNotificationTypeAlert' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
notificationTypes |= UIUserNotificationTypeAlert;
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:17:32: note: 'UIUserNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIUserNotificationType) {
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:51:28: warning: 'UIUserNotificationTypeBadge' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
notificationTypes |= UIUserNotificationTypeBadge;
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:17:32: note: 'UIUserNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIUserNotificationType) {
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:52:7: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:52:74: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:53:42: warning: 'registerUserNotificationSettings:' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:] [-Wdeprecated-declarations]
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:250:1: note: 'registerUserNotificationSettings:' has been explicitly marked deprecated here
- (void)registerUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings API_DEPRECATED("Use UserNotifications Framework's -[UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:] and -[UNUserNotificationCenter setNotificationCategories:]", ios(8.0, 10.0)) API_UNAVAILABLE(tvos);
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:75:5: warning: 'UIUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNNotificationSettings [-Wdeprecated-declarations]
UIUserNotificationSettings * setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
^
In module 'UIKit' imported from /Users/Suresh-IoTMinds/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:44:12: note: 'UIUserNotificationSettings' has been explicitly marked deprecated here
@interface UIUserNotificationSettings : NSObject
^
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:75:79: warning: 'currentUserNotificationSettings' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:] [-Wdeprecated-declarations]
UIUserNotificationSettings * setting = [[UIApplication sharedApplication] currentUserNotificationSettings];
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:253:70: note: property 'currentUserNotificationSettings' is declared deprecated here
@property(nonatomic, readonly, nullable) UIUserNotificationSettings *currentUserNotificationSettings API_DEPRECATED("Use UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] and -[UNUserNotificationCenter getNotificationCategoriesWithCompletionHandler:]", ios(8.0, 10.0)) API_UNAVAILABLE(tvos);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:253:70: note: 'currentUserNotificationSettings' has been explicitly marked deprecated here
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/NotificationPermissionStrategy.m:76:26: warning: 'UIUserNotificationTypeNone' is deprecated: first deprecated in iOS 10.0 - Use UserNotifications Framework's UNAuthorizationOptions [-Wdeprecated-declarations]
if (setting.types == UIUserNotificationTypeNone) permissionStatus = PermissionStatusDenied;
^
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIUserNotificationSettings.h:17:32: note: 'UIUserNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIUserNotificationType) {
^
10 warnings generated.
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/BluetoothPermissionStrategy.m:31:31: warning: 'CBCentralManagerStatePoweredOn' is deprecated: first deprecated in iOS 10.0 - Use CBManagerState instead [-Wdeprecated-declarations]
return [manager state] == CBCentralManagerStatePoweredOn ? ServiceStatusEnabled : ServiceStatusDisabled;
^
In module 'CoreBluetooth' imported from /Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-7.1.0/ios/Classes/strategies/BluetoothPermissionStrategy.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/CoreBluetooth.framework/Headers/CBCentralManager.h:35:28: note: 'CBCentralManagerState' has been explicitly marked deprecated here
typedef NS_ENUM(NSInteger, CBCentralManagerState) {
^
1 warning generated.
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/in_app_review-2.0.2/ios/Classes/InAppReviewPlugin.m:36:38: error: no known class method for selector 'requestReviewInScene:'
[SKStoreReviewController requestReviewInScene:scene];
^~~~~~~~~~
/Users/Sureace/flutter/.pub-cache/hosted/pub.dartlang.org/in_app_review-2.0.2/ios/Classes/InAppReviewPlugin.m:99:14: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
[app openURL:url];
^
openURL:options:completionHandler:
In module 'UIKit' imported from /Users/Sureace/Development/iotecom/ios/Pods/Target Support Files/in_app_review/in_app_review-prefix.pch:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:123:1: note: 'openURL:' has been explicitly marked deprecated here
- (BOOL)openURL:(NSURL)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", ios(2.0, 10.0)) NS_EXTENSION_UNAVAILABLE_IOS("");
^
1 warning and 1 error generated.
environment:
sdk: ">=2.10.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
shared_preferences: ^2.0.5
introduction_screen: ^2.1.0
flutter_swiper: ^1.1.6
easy_localization: ^3.0.0
firebase_core: ^1.1.0
firebase_auth: ^1.1.2
cloud_firestore: ^1.0.7
provider: ^5.0.0
permission_handler: ^7.1.0
url_launcher: ^6.0.3
fluttertoast: ^8.0.6
pin_code_fields: ^7.0.0
connectivity: ^3.0.3
cloud_functions: ^1.0.5
firebase_messaging: ^9.1.3
flutter_typeahead: ^3.1.2
uuid: ^3.0.4
dio: ^4.0.0
equatable: ^2.0.0
cached_network_image: ^3.0.0
package_info: ^2.0.0
http: ^0.13.2
flutter_calendar_carousel: ^2.0.1
in_app_review: ^2.0.2
razorpay_flutter: ^1.2.5
ext_storage: ^1.0.3
image_gallery_saver: ^1.6.9
sms_autofill: ^2.0.0
share: ^2.0.1
cupertino_icons: ^1.0.2
Thanks,
Sureace
I've got the same issue , any solution ?
Fixed when upgraded my xcode from 11.x to 12.x.
Most helpful comment
@randikachan at the moment the only difference is that version
5.1.0+2contains support for the iOSPERMISSION_PHOTOSpermission. This is a new feature in iOS 14+ and therefore requires Xcode 12 and higher.There is no other difference between the two versions you mentioned. Since you and your team decided to pin the environment to Xcode 11.2.1 you are not (yet) interested in new iOS 14+ features and therefore pinning the
permission_handlerto5.0.1+2doesn't have any impact on your App for now.Of course new development on the
permission_handlerwill continue on the new set of requirements meaning that this might change in the future (i.e. we are currently in the process of adding null safety support, which will only be available based on the5.1.0+2version).