I use this code to add events to the calendar app on iOS
int i = 0;
for(Schedule *sche in scheduleArray){
EKEventStore *eventStore=[[EKEventStore alloc] init];
EKEvent *addEvent=[EKEvent eventWithEventStore:eventStore];
addEvent.title=#"hello";
addEvent.startDate=[NSDate date];
addEvent.endDate=[addEvent.startDate dateByAddingTimeInterval:600];
[addEvent setCalendar:[eventStore defaultCalendarForNewEvents]];
addEvent.alarms=[NSArray arrayWithObject:[EKAlarm alarmWithAbsoluteDate:addEvent.startDate]];
NSError *err;
[eventStore saveEvent:addEvent span:EKSpanThisEvent error:&err];
if (err == nil) {
NSString* str = [[NSString alloc] initWithFormat:#"%#", addEvent.eventIdentifier];
NSLog(#"String %d: %#",i, str);
}
else {
NSLog(#"Error %#",err);
}
i++;
}
I want to add all events with data i saved before in scheduleArray, i have 86 object in scheduleArray, but it seem i only add about 82 events to calendar. Here is my log result:
.......
2013-02-19 14:04:28.237 MyDTUSchedule[5382:6607] String 67: BBCF7782-5D60-42D7-8478-EF80604FBF41:4A9E6404-B35B-4534-A7F2-5C6082F3D19A
2013-02-19 14:04:28.284 MyDTUSchedule[5382:6607] String 68: BBCF7782-5D60-42D7-8478-EF80604FBF41:47F0B6CF-3F98-49F9-B407-7A28B4F12C83
2013-02-19 14:04:28.343 MyDTUSchedule[5382:6607] String 69: BBCF7782-5D60-42D7-8478-EF80604FBF41:FB802E03-876D-4ADB-93B9-C3FAB628FF57
2013-02-19 14:04:28.412 MyDTUSchedule[5382:6607] String 70: BBCF7782-5D60-42D7-8478-EF80604FBF41:21786B81-BAC8-4979-9A04-B63CE404B870
2013-02-19 14:04:28.479 MyDTUSchedule[5382:6607] String 71: BBCF7782-5D60-42D7-8478-EF80604FBF41:9CF1DDA5-B8F3-4835-A5BC-A9FE745E17D1
2013-02-19 14:04:28.503 MyDTUSchedule[5382:6607] String 72: BBCF7782-5D60-42D7-8478-EF80604FBF41:834BE2CE-E810-4EA7-ACFC-01FAAA46453E
2013-02-19 14:04:28.580 MyDTUSchedule[5382:6607] String 73: BBCF7782-5D60-42D7-8478-EF80604FBF41:BFBDBECF-1A31-4363-9FD2-66C05F4085B9
2013-02-19 14:04:28.629 MyDTUSchedule[5382:6607] String 74: BBCF7782-5D60-42D7-8478-EF80604FBF41:3512265D-10A9-40AE-8435-0BDBC1D72A1B
2013-02-19 14:04:28.690 MyDTUSchedule[5382:6607] String 75: BBCF7782-5D60-42D7-8478-EF80604FBF41:96C68CAC-2955-4EDD-8FE2-442CDDDE39A8
2013-02-19 14:04:28.733 MyDTUSchedule[5382:6607] String 76: BBCF7782-5D60-42D7-8478-EF80604FBF41:2724EBFD-AB03-4E6A-8094-25D7035B517C
2013-02-19 14:04:28.818 MyDTUSchedule[5382:6607] String 77: BBCF7782-5D60-42D7-8478-EF80604FBF41:CC14386F-E21A-41AA-82D5-42B05149EB09
2013-02-19 14:04:28.865 MyDTUSchedule[5382:6607] String 78: BBCF7782-5D60-42D7-8478-EF80604FBF41:3738B384-21B9-4544-8DD2-C50032B5404D
2013-02-19 14:04:28.929 MyDTUSchedule[5382:6607] String 79: BBCF7782-5D60-42D7-8478-EF80604FBF41:70F820A8-37A5-4CC1-8E0E-696736CABC2C
2013-02-19 14:04:28.964 MyDTUSchedule[5382:6607] String 80: BBCF7782-5D60-42D7-8478-EF80604FBF41:864E4DEF-275F-4458-A5E2-A136C2F57982
2013-02-19 14:04:29.019 MyDTUSchedule[5382:6607] String 81: BBCF7782-5D60-42D7-8478-EF80604FBF41:061BF4AE-6BD5-4B3E-B2FC-35A18A7D99A5
2013-02-19 14:04:29.042 MyDTUSchedule[5382:6607] Error Error Domain=EKErrorDomain Code=1 "No calendar has been set." UserInfo=0xe21da30 {NSLocalizedDescription=No calendar has been set.}
2013-02-19 14:04:29.052 MyDTUSchedule[5382:6607] Error Error Domain=EKErrorDomain Code=1 "No calendar has been set." UserInfo=0xe1551d0 {NSLocalizedDescription=No calendar has been set.}
2013-02-19 14:04:29.054 MyDTUSchedule[5382:6607] Error Error Domain=EKErrorDomain Code=1 "No calendar has been set." UserInfo=0xe21bf90 {NSLocalizedDescription=No calendar has been set.}
2013-02-19 14:04:29.058 MyDTUSchedule[5382:6607] Error Error Domain=EKErrorDomain Code=1 "No calendar has been set." UserInfo=0xe21abd0 {NSLocalizedDescription=No calendar has been set.}
I don't know why these errors happen? How can i add all my events to the calendar?
Related
In flutter 1.22 it was working good but when I upgraded my flutter project to 2.0 its giving me some error while flutter run
My dependence:
dependencies:
flutter:
sdk: flutter
keyboard_avoider: #Already UP TO DATE update checked on 28/12/2020
http: #Already UP TO DATE update checked on 28/12/2020
connectivity: #old- 0.4.9+5 UP TO DATE update checked on 28/12/2020
html: #already UP TO DATE update checked on 28/12/2020
string_validator: #already UP TO DATE update checked on 28/12/2020
shared_preferences: #old-0.5.12+2 UP TO DATE update checked on 28/12/2020
simple_animations: #old-1.3.3 UP TO DATE update checked on 28/12/2020 for toast animation
progress_dialog: # already UP TO DATE update checked on 28/12/2020 for progress dialog can also use for show download contain percentage,update
device_info: #old-0.4.2+9 UP TO DATE update checked on 28/12/2020
package_info: #old-0.4.3 UP TO DATE update checked on 28/12/2020
timeago: #old-2.0.29 UP TO DATE update checked on 28/12/2020
date_format: #already UP TO DATE update checked on 28/12/2020
datetime_picker_formfield: #already UP TO DATE update checked on 28/12/2020
intl: #already UP TO DATE update checked on 28/12/2020
flutter_multiselect: #already UP TO DATE update checked on 28/12/2020
flutter_local_notifications: #already UP TO DATE update checked on 28/12/2020
flutter_picker: #already UP TO DATE update checked on 28/12/2020
f_logs: #old-1.3.0-alpha-01 UP TO DATE update checked on 28/12/2020
image_picker: #old-^0.6.5-alpha-01 UP TO DATE update checked on 28/12/2020
image_cropper: #already UP TO DATE update checked on 28/12/2020
flutter_uploader: #old-^1.2.0 UP TO DATE update checked on 28/12/2020
flutter_downloader: #old-^1.4.1 UP TO DATE update checked on 28/12/2020
provider: #old-^3.1.0+1 UP TO DATE update checked on 28/12/2020
flutter_email_sender: #old-^3.0.1 UP TO DATE update checked on 28/12/2020
path_provider: #^2.0.1 #^1.6.24 #old-^1.6.7 UP TO DATE update checked on 28/12/2020
flutter_full_pdf_viewer: #already UP TO DATE update checked on 28/12/2020
flutter_archive: #old-1.0.2 UP TO DATE update checked on 28/12/2020
webview_flutter: #old-0.3.14 UP TO DATE update checked on 28/12/2020
platform_action_sheet: #already UP TO DATE update checked on 28/12/2020
get_it: #old- UP TO DATE update checked on 28/12/2020
url_launcher: #6.0.2 #old- 5.0.3 UP TO DATE update checked on 28/12/2020
filesize: #already UP TO DATE update checked on 28/12/2020
contacts_service: #old- 0.3.10 UP TO DATE update checked on 28/12/2020
permission_handler: #old-4.0.0 UP TO DATE update checked on 28/12/2020
photo_view: #old-0.9.2 UP TO DATE update checked on 28/12/2020
flutter_share: #old- 1.0.2+1 UP TO DATE update checked on 28/12/2020
cached_network_image: #old- 2.3.3 UP TO DATE update checked on 28/12/2020
flutter_cache_manager: #old-2.0.0 UP TO DATE update checked on 28/12/2020
flushbar: #old- 1.10.4 UP TO DATE update checked on 28/12/2020
get: #old- 2.13.0 UP TO DATE update checked on 28/12/2020
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: #old-0.1.2 UP TO DATE update checked on 28/12/2020
material_design_icons_flutter: #old-3.4.5045 UP TO DATE update checked on 29/12/2020
firebase_messaging: #^6.0.16 #6.0.16 alternate version
firebase_analytics: #old-6.3.0 UP TO DATE update checked on 29/12/2020
firebase_crashlytics: #^1.0.0 #old-0.1.3+3 UP TO DATE update checked on 29/12/2020
firebase_auth: #^1.0.1 #^0.16.1 #old-0.18.4+1 UP TO DATE update checked on 29/12/2020
firebase_core: #^1.0.1 #^0.4.4 #0.5.3
google_sign_in: #old-4.5.1 UP TO DATE update checked on 29/12/2020
pull_to_refresh:
shimmer:
archive: #already UP TO DATE update checked on 29/12/2020
flutter_slidable: #already UP TO DATE update checked on 29/12/2020
flutter_launcher_icons:
file_picker: #old-1.9.0 UP TO DATE update checked on 29/12/2020
percent_indicator: #old-2.1.7+4 UP TO DATE update checked on 29/12/2020
flutter_section_table_view: #already UP TO DATE update checked on 29/12/2020
international_phone_input: #already UP TO DATE update checked on 29/12/2020for formating mobile number
firebase_dynamic_links: #old- 0.6.3 UP TO DATE update checked on 29/12/2020 #for creating dynamic link
intl_phone_number_input: #old-0.4.6+2 UP TO DATE update checked on 29/12/2020 #for international number input
flutter_open_whatsapp: #already UP TO DATE update checked on 29/12/2020
Error
Running Xcode build...
Xcode build done. 29.3s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:80:42: error:
incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
75: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:87:42: error:
incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
75: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:96:42: error:
incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
75: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:109:21:
warning: 'fetchProvidersForEmail:completion:' is deprecated: Please use fetchSignInMethodsForEmail:completion: for Objective-C or
fetchSignInMethods(forEmail:completion:) for Swift instead. [-Wdeprecated-declarations]
[[FIRAuth auth] fetchProvidersForEmail:email
^
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:398:
5: note: 'fetchProvidersForEmail:completion:' has been explicitly marked deprecated here
DEPRECATED_MSG_ATTRIBUTE("Please use fetchSignInMethodsForEmail:completion: for Objective-C or "
^
In module 'UIKit' imported from /Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Target Support
Files/firebase_auth/firebase_auth-prefix.pch:2:
In module 'Foundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
works/UIKit.framework/Headers/UIKit.h:8:
In module 'CoreFoundation' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
works/Foundation.framework/Headers/Foundation.h:6:
In module 'Darwin' imported from
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/System/Library/Frame
works/CoreFoundation.framework/Headers/CoreFoundation.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.1.sdk/usr/include/Availabi
lityMacros.h:181:64: note: expanded from macro 'DEPRECATED_MSG_ATTRIBUTE'
#define DEPRECATED_MSG_ATTRIBUTE(s) __attribute__((deprecated(s)))
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:160:52:
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
73: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:169:52:
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
73: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:176:52:
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
73: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:185:52:
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h:401:
73: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:276:42:
error: incompatible block pointer types sending 'void (^)(FIRUser *__strong, NSError *__strong)' to parameter of type 'void (^
_Nullable)(FIRAuthDataResult * _Nullable __strong, NSError * _Nullable __strong)'
completion:^(FIRUser *user, NSError *error) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'FirebaseAuth' imported from
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/Headers/Public/Firebase/Firebase.h:30:
/Users/siddhant/Siddhant_WorkSpace/Speridian_Work/TC_Latest/ios/Pods/FirebaseAuth/FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h:573:
75: note: passing argument to parameter 'completion' here
NSError *_Nullable error))completion;
^
/Users/siddhant/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.6.2+1/ios/Classes/FirebaseAuthPlugin.m:300:62:
warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
userData[#"lastSignInTimestamp"] = [NSNumber numberWithInt:lastSignInDate];
~ ^~~~~~~~~~~~~~
2 warnings and 8 errors generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
I have tried deleting the podFile, Podlock, Pod and .symlinks. Have even upgrade the cocapods. ran flutter doctor also its giving me all ticks. Any suggestion pls let me know thanks for the help in advance.
Rollback to 1.22 and wait stable version on Flutter 2.
Flutter 2 introduce Null Safety which can cause issues on Flutter 1.22 based projects.
Please use firebase related all version compatible. if you use firebase_auth: ^0.20.0+1 then firebase_dynamic_links: ^0.7.0+1 firebase_messaging: ^8.0.0-dev.12 firebase_storage: ^7.0.0 firebase_core : ^0.7.0
I'm programming in swift and run into an error that my WKWebView turns black after "open link" or "add to photos" in safari.
So I got my WebView and everything works fine. But when I long press on (e.g. an image) the apple-dropdown-menu opens with "open link", "add to reading list", ..., "add to photos". Now when I just close the dropdown menu again and go to home screen and open the app again, the webview turns black. The console says it's loading and didFinish, but I can't see anything. Anyone knows possible issues?
When I pressed "open link" on the dropdown-menu safari opens with that link. But when I move back to my app, the screen turns black. Here is the code of the console after opening my app again.
--------------------- SCENEDELEGATE sceneWillEnterForeground ---------------------
2020-08-13 13:48:38.560642+0200 GMP[1817:418564] [ProcessSuspension] 0x282f2aa00 - WKProcessAssertionBackgroundTaskManager: Ignored request to start a new background task because the application is already in the background
2020-08-13 13:48:38.561286+0200 GMP[1817:418564] [ProcessSuspension] 0x282f2aa00 - WKProcessAssertionBackgroundTaskManager: Ignored request to start a new background task because the application is already in the background
--------------------- SCENEDELEGATE sceneDidBecomeActive ---------------------
currentUrl: https://myWebPage.com/
loadUrl(link: https://myWebPage.com/)
didStartProvisionalNavigation webView(_:didStartProvisionalNavigation:)
didCommit webView(_:didCommit:)
2020-08-13 13:48:39.341814+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ff4db0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102c8f640; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.341902+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0438 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1819
2020-08-13 13:48:39.342137+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0438 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.342917+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ff4de0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x1040ae040; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.342998+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0460 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1817
2020-08-13 13:48:39.343085+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0460 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.343851+0200 GMP[1817:418614] [assertion] Error acquiring assertion: <NSError: 0x282ffcea0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x10415ddb0; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.343954+0200 GMP[1817:418614] [ProcessSuspension] 0x1094e0488 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1818
2020-08-13 13:48:39.344028+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e0488 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.905526+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f3b690; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x10414ea00; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.905574+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20a8 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1819
2020-08-13 13:48:39.905602+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20a8 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.906163+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f39590; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102d4d0c0; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.906196+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20d0 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1817
2020-08-13 13:48:39.906218+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20d0 - ProcessAssertion::processAssertionWasInvalidated()
2020-08-13 13:48:39.906769+0200 GMP[1817:418815] [assertion] Error acquiring assertion: <NSError: 0x282f391d0; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x102c66420; requestedReason: FinishTaskUnbounded; reason: FinishTaskUnbounded; flags: PreventTaskSuspend>;
}
}
2020-08-13 13:48:39.906803+0200 GMP[1817:418815] [ProcessSuspension] 0x1094e20f8 - ProcessAssertion() PID 1817 Unable to acquire assertion for process with PID 1818
2020-08-13 13:48:39.906828+0200 GMP[1817:418564] [ProcessSuspension] 0x1094e20f8 - ProcessAssertion::processAssertionWasInvalidated()
didFinish webView(_:didFinish:)
didSet currentUrl = https://myWebPage.com/
I am trying to create a simple AVBasicPlayBack for Mac OS 10.14.5 Xcode 10.2.1 swift 5.0.1. I used AVPlayer it is throwing some errors. New to Mac OS Development could not figure out what is wrong. I have checked lots of documentation online.
I added NSAppTransportSecurity to info.plist file shown below.
info.plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 Personal. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>devimages-cdn.apple.com</key>
<dict/>
<key>NSExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</dict>
</plist>
ViewController.swift
import Cocoa
import AVKit
class ViewController: NSViewController {
#IBOutlet weak var playerView: AVPlayerView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
guard let url = URL(string: "https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8")
else {
return
}
// Create a new AVPlayer and associate it with the player view
//let player = AVPlayer(url: url)
//playerView.player = player
let avAsset = AVURLAsset(url: url, options: nil)
let playerItem = AVPlayerItem(asset: avAsset)
let videoPlayer = AVPlayer(playerItem: playerItem)
playerView.player = videoPlayer
videoPlayer.play()
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
}
I get the following errors
2019-06-23 14:03:10.958123-0700 AVBasicPlayback[27278:6522581] [] nw_dictionary_set_value called with null dictionary
2019-06-23 14:03:10.958154-0700 AVBasicPlayback[27278:6522581] [] __nwlog_err_simulate_crash simulate crash failed "nw_dictionary_set_value called with null dictionary"
2019-06-23 14:03:10.958334-0700 AVBasicPlayback[27278:6522581] [] nw_dictionary_set_value called with null dictionary, dumping backtrace:
[x86_64] libnetcore-1229.250.15
0 libnetwork.dylib 0x00007fff747f8c88 __nw_create_backtrace_string + 120
1 libnetwork.dylib 0x00007fff7454cb09 nw_dictionary_set_value + 265
2 libnetwork.dylib 0x00007fff745e5bce nw_path_evaluator_cancel + 654
3 MediaToolbox 0x00007fff4e8ca975 FigMetadataReaderCreateForBoxedMetadata + 10998
4 MediaToolbox 0x00007fff4ea170f3 FigBytePumpCreateForHTTPChunk + 73903
5 MediaToolbox 0x00007fff4ea06752 FigBytePumpCreateForHTTPChunk + 5902
6 libdispatch.dylib 0x000000010034bf1b _dispatch_client_callout + 8
7 libdispatch.dylib 0x0000000100354067 _dispatch_lane_serial_drain + 773
8 libdispatch.dylib 0x0000000100354f4e _dispatch_lane_invoke + 493
9 libdispatch.dylib 0x000000010035e824 _dispatch_root_queue_drain + 334
10 libdispatch.dylib 0x000000010035e60b _dispatch_worker_thread + 271
11 libsystem_pthread.dylib 0x00000001003c5dc3 _pthread_body + 126
12 libsystem_pthread.dylib 0x00000001003c8e8d _pthread_start + 66
13 libsystem_pthread.dylib 0x00000001003c4e11 thread_start + 13
2019-06-23 14:03:10.964828-0700 AVBasicPlayback[27278:6522533] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
2019-06-23 14:03:10.973122-0700 AVBasicPlayback[27278:6522533] startConfigurationWithCompletionHandler: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
2019-06-23 14:03:10.982169-0700 AVBasicPlayback[27278:6522553] Received XPC error Connection invalid for message type 3 kCFNetworkAgentXPCMessageTypePACQuery
2019-06-23 14:03:10.982216-0700 AVBasicPlayback[27278:6522553] PAC result block not invoked
2019-06-23 14:03:10.982273-0700 AVBasicPlayback[27278:6522553] [] nw_proxy_resolver_create_parsed_array PAC evaluation error: kCFErrorDomainCFNetwork: 308
2019-06-23 14:03:10.984342-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 1
2019-06-23 14:03:11.988908-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 2
2019-06-23 14:03:12.990000-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect()-> No of tries: 3
2019-06-23 14:03:13.995302-0700 AVBasicPlayback[27278:6522553] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:11 Err:-1 Errno:1 Operation not permitted
2019-06-23 14:03:13.996203-0700 AVBasicPlayback[27278:6522553] [] nw_resolver_create_dns_service_locked [C1.1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2019-06-23 14:03:13.997244-0700 AVBasicPlayback[27278:6522553] TIC TCP Conn Failed [1:0x600003716280]: 10:-72000 Err(-65563)
2019-06-23 14:03:13.998574-0700 AVBasicPlayback[27278:6522520] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> HTTP load failed (error code: -1003 [10:-72000])
2019-06-23 14:03:13.998782-0700 AVBasicPlayback[27278:6522520] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> finished with error - code: -1003
2019-06-23 14:03:14.005116-0700 AVBasicPlayback[27278:6522581] Task <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x600000cdc270 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <B5B5187F-14BA-498B-91F3-630EE49FBFC0>.<1>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8, NSErrorFailingURLKey=https://devimages-cdn.apple.com/samplecode/avfoundationMedia/AVFoundationQueuePlayer_HLS2/master.m3u8, _kCFStreamErrorDomainKey=10} [-1003]
2019-06-23 14:03:14.007457-0700 AVBasicPlayback[27278:6522520] sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.rtcreportingd" UserInfo={NSDebugDescription=connection to service named com.apple.rtcreportingd}
Select "Outgoing Connections (Client)" checkbox in "App Capabilities". This started displaying video but still some errors. I will update answer after I find solution for the remaining errors. Errors are regarding XPC.
I am trying to implement mongodb text search in jsp page but I am getting an error. Below is my code and error. Please let me know if you find some thing wrong with my code.
Your help is greatly appreciated. Thanks in advance.
Code:
Mongo m=new MongoClient("localhost",27017);
DB db = m.getDB("sagar");
String searchText="samosa";
DBCollection collection=db.getCollection("review");
DBObject searchCmd = new BasicDBObject();
searchCmd.put("text",collection);
searchCmd.put("search",searchText);
DBCursor cursor = collection.find(searchCmd);
while(cursor.hasNext())
{
System.out.println(cursor.next());
}
Error:
type Exception report
message An exception occurred processing JSP page /review.jsp at line 33
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /review.jsp at line 33
30: String id= (String) dbo.get("text");
31: out.println(id+"\n");
32: }*/
33: while(cursor.hasNext())
34: {
35: System.out.println(cursor.next());
36: }
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.IllegalArgumentException: can't serialize class com.mongodb.DBCollectionImpl
org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:299)
org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194)
org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:136)
com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:36)
com.mongodb.OutMessage.putObject(OutMessage.java:289)
com.mongodb.OutMessage.writeQuery(OutMessage.java:211)
com.mongodb.OutMessage.query(OutMessage.java:86)
com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:83)
com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:68)
com.mongodb.DBCursor._check(DBCursor.java:498)
com.mongodb.DBCursor._hasNext(DBCursor.java:621)
com.mongodb.DBCursor.hasNext(DBCursor.java:657)
org.apache.jsp.review_jsp._jspService(review_jsp.java:93)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
You are trying map collection object to value with key text:
searchCmd.put("text",collection)
You may need to do only searchCmd.put("search",searchText);
Like, db.reviews.find({"search":"samosa"})
I got error in NSPredicate
"*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "title tcontains[cd] %#"'
*** First throw call stack:
(0x15d6012 0x13fbe7e 0xe14355 0xe14173 0xe14127 0x5b68 0x5deb 0x626ff3 0x576c86 0x140f705 0x343213 0x404c7e 0x404310 0x41113c 0x41b5a6 0xebc4f9 0x16300c5 0x158aefa 0xdf0bb2 0x406e9de 0x31bc1da 0x35f5dfc 0x35f8bf8 0x4049612 0x404974a 0x4049ec0 0x4049cb8 0x4049204 0x343722b 0x3437193 0x401be96 0x40484cc 0x35f3136 0x35f23c6 0x3625980 0x3c817fd 0x361c576 0x361d6da 0x361b72e 0x3c7feaa 0x3635af1 0x362572a 0x35f96ae 0x31f862b 0x140f6b0 0x4064810 0x32371a4 0x32392ff 0x5010b4 0x4c3aef 0x4c4e58 0x4c39fe 0x4cdd29 0x350ddb 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x44e7f5 0x350e35 0x350806 0x350beb 0x342698 0x22fcdf9 0x22fcad0 0x154bbf5 0x154b962 0x157cbb6 0x157bf44 0x157be1b 0x22fb7e3 0x22fb668 0x33fffc 0x201d 0x1f45)
libc++abi.dylib: terminate called throwing an exception"
Please help me.
Here is the my code
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
[searchResults removeAllObjects];
NSString *str1 = [searchText stringByReplacingOccurrencesOfString:#"\"" withString:#""];
NSLog(#"data_arra==>%#",arr_search);
NSLog(#"searchText==>%#",searchText);
NSPredicate *resultPredicate = [NSPredicate
predicateWithFormat:#"title tcontains[cd] %#",
str1];
NSLog(#"result==>%#",resultPredicate);
searchResults = [NSMutableArray arrayWithArray:[arr_search filteredArrayUsingPredicate:resultPredicate]];
}
array value for arr_search
arr_search ==>(
"Phoenix Market City",
"Express Avenue",
"Ampa Skywalk",
"The Forum Vijaya Mall",
"Chennai Citi Centre",
"Spencer Plaza",
"Chandra Metro Mall",
"The Grand Mall",
"Ramee Mall",
"Alsa Mall",
"Prince Plaza",
"Ispahani Centre",
"Fountain Plaza",
Lifestyle,
"Grand Venus Spectrum Mall",
"Raahat Palaza",
"Patni Plaza",
"Maya Plaza",
"Phoenix Mall, Chennai",
Megamart,
"Phoenix marketcity",
Aldo,
"Gokul Arcade",
"Parsn Complex",
"Spectrum mall",
"Express Avenue Chambers",
"Big Bazaar",
"Spencer's",
"Saravana Stores",
"CEX (complete entertainment exchange)"
)
I think it's typo error in this
NSPredicate *resultPredicate = [NSPredicate
predicateWithFormat:#"title tcontains[cd] %#",
str1];
It should be
NSPredicate *resultPredicate = [NSPredicate
predicateWithFormat:#"title contains[cd] %#",
str1];