urbanairship / ios-library

Urban Airship iOS SDK
http://urbanairship.com
Apache License 2.0
478 stars 265 forks source link

Main thread crash while Migration 16.11.3 to 17.7.3 #392

Closed bilalmarifet closed 6 months ago

bilalmarifet commented 6 months ago

❗For how-to inquiries involving Airship functionality or use cases, please new implementation requires main actor tag, old one without (it's called in didFinishLaunchingWithOptions) @MainActor func configure(in environment: Environment, launchOptions: [AnyHashable: Any]) { let config = AirshipConfig.default() config.urlAllowList = [ "https://*" ] config.site = .eu config.detectProvisioningMode = false config.inProduction = environment.airshipConfiguration.inProduction config.developmentAppKey = environment.airshipConfiguration.developmentAppKey config.developmentAppSecret = environment.airshipConfiguration.developmentAppSecret config.productionAppKey = environment.airshipConfiguration.productionAppKey config.productionAppSecret = environment.airshipConfiguration.productionAppSecret config.developmentLogLevel = makeLogLevel(from: environment.airshipConfiguration.developmentLogLevel) config.productionLogLevel = makeLogLevel(from: environment.airshipConfiguration.productionLogLevel) Airship.takeOff(config, launchOptions: (launchOptions as? [UIApplication.LaunchOptionsKey: Any]) ?? [:]) Airship.push.backgroundPushNotificationsEnabled = true }

after adding main actor tag i faced main thread issues Please fill out this template when submitting an issue.

All lines beginning with an ℹ symbol indicate information that's important for you to provide to ensure your issue is resolved as quickly and efficiently as possible.

-->

Preliminary Info

What Airship dependencies are you using?

17.8.0

What are the versions of any relevant development tools you are using?

xcode 15.0

Report

What unexpected behavior are you seeing?

Screenshot 2024-03-13 at 11 53 21

What is the expected behavior?

expected behavior is working fine without crash

What are the steps to reproduce the unexpected behavior?

every time open app.

Do you have logging for the issue?

2024-03-13 11:58:11.870853+0300 -[70892:468357] - <AppMeasurement>[I-ACS036001] Analytics screen reporting is disabled. UIViewController transitions will not be logged. 2024-03-13 11:58:12.185120+0300 -[70892:468064] [Airship] [I] AirshipCore/Airship.swift commonTakeOff(_:) [Line 356] Airship TakeOff! SDK Version 17.8.0, App Key: -------, inProduction: false 2024-03-13 11:58:12.218890+0300 -[70892:468064] [Airship] [I] AirshipCore/Channel.swift init(dataStore:config:privacyManager:localeManager:audienceManager:channelRegistrar:notificationCenter:appStateTracker:) [Line 197] Channel ID ------ 2024-03-13 11:58:12.302584+0300 -[70892:468064] [Airship] [D] AirshipCore/ModuleLoader.swift loadModules(_:) [Line 122] Loading module messageCenter 2024-03-13 11:58:12.315198+0300 -[70892:468064] [Airship] [D] AirshipCore/ModuleLoader.swift loadLegacyModules(_:) [Line 140] Loading module automation 2024-03-13 11:58:12.329696+0300 -[70892:468064] [Airship] [I] AirshipCore/Airship.swift commonTakeOff(_:) [Line 364] Automatic setup enabled. 2024-03-13 11:58:12.332668+0300 -[70892:468064] [Airship] [D] -[UAAutomationEngine updateTriggersWithScheduleID:type:argument:incrementAmount:] [Line 677] Updating triggers with type: 7 2024-03-13 11:58:12.357376+0300 -[70892:468358] [Request] Request: 2024-03-13 11:58:12.371608+0300 -[70892:468356] [Airship] [D] AirshipCore/UACoreData.swift createSqlStore(storeName:) [Line 466] Created store: In-app-automation-h9flq2GATH6rny2Nfl1spQ.sqlite url: --- 2024-03-13 11:58:12.383904+0300 -[70892:468357] [Airship] [D] AirshipCore/UACoreData.swift createSqlStore(storeName:) [Line 466] Created store: RemoteData-h9flq2GATH6rny2Nfl1spQ.sqlite url: --- 2024-03-13 11:58:12.423131+0300 -[70892:468356] [Airship] [D] AirshipCore/UACoreData.swift createSqlStore(storeName:) [Line 466] Created store: Automation-h9flq2GATH6rny2Nfl1spQ.sqlite url: --- 2024-03-13 11:58:12.729134+0300 -[70892:468064] Metal API Validation Enabled 2024-03-13 11:58:14.150376+0300 -[70892:468064] [Airship] [I] AirshipCore/DefaultAppIntegrationDelegate.swift didRegisterForRemoteNotifications(deviceToken:) [Line 41] Application registered device token: --- 2024-03-13 11:58:14.150620+0300 -[70892:468064] [Airship] [I] AirshipCore/Push.swift didRegisterForRemoteNotifications(_:) [Line 1198] Device token string: --- 2024-03-13 11:58:14.150820+0300 -[70892:468064] [Airship] [I] AirshipCore/Push.swift deviceToken [Line 440] Device token: ---2024-03-13 11:58:14.151519+0300 -[70892:468450] [Airship] [D] AirshipCore/Analytics.swift addEvent(_:date:sessionID:) [Line 367] Adding event with type device_registration=================================================================Main Thread Checker: UI API called on a background thread: -[UIView layer] PID: 70892, TID: 468400, Thread name: (none), Queue name: com.apple.root.user-initiated-qos.cooperative, QoS: 25 Backtrace: 4 - 0x000000010194c990 $s2-15QuickFilterViewC17setupDataProvider33_3BC73FA94A44BE3EA584C545F2DC59D8LLyyFyAC_AA0bcD5ModelVtcfU_ + 148 5 - 0x000000010142e98c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xtctRld__ClFyxSg_xtcfU_ + 260 6 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 7 - 0x00000001016eed8c $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_yAA011QuickFilterfR0VXEfU_ + 468 8 - 0x00000001016ef028 $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_yAA011QuickFilterfR0VXEfU_TA + 24 9 libswiftCore.dylib 0x000000018bc4cb28 $s-3mapyqd__Sgqd__xKXEKlF + 240 10 - 0x00000001016ee9f4 $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_ + 340 11 - 0x000000010142e98c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xtctRld__ClFyxSg_xtcfU_ + 260 12 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 13 - 0x00000001012c0848 $s2-23ChargeMapViewControllerC25setupControlsDataProvider33_58472D5868F9565E69FB409C08E8552CLLyyFyAC_AA0bcgD5ModelVSgAGtcfU_ + 724 14 - 0x000000010142ef1c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xSgxtctRld__ClFyAF_xtcfU_ + 268 15 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 16 - 0x0000000101275a6c $s2-20ChargeMapCoordinatorC06updatebC17ControlsViewModel33_BB8275D347CF8DBB28DF3D51E2C14140LLyyFyyYaYbcfU_TY2_ + 292 17 libswift_Concurrency.dylib 0x00000001ae37f438 _ZN5swift34runJobInEstablishedExecutorContextEPNS_3JobE + 336 18 libswift_Concurrency.dylib 0x00000001ae3800b0 _ZL17swift_job_runImplPN5swift3JobENS_11ExecutorRefE + 80 19 libdispatch.dylib 0x00000001133f0fb4 _dispatch_continuation_pop + 152 20 libdispatch.dylib 0x00000001133f0190 _dispatch_async_redirect_invoke + 904 21 libdispatch.dylib 0x00000001134028ac _dispatch_root_queue_drain + 440 22 libdispatch.dylib 0x000000011340353c _dispatch_worker_thread2 + 248 23 libsystem_pthread.dylib 0x00000001126777d8 _pthread_wqthread + 224 24 libsystem_pthread.dylib 0x00000001126765d4 start_wqthread + 8 2024-03-13 11:58:14.165938+0300 -[70892:468400] [reports] Main Thread Checker: UI API called on a background thread: -[UIView layer] PID: 70892, TID: 468400, Thread name: (none), Queue name: com.apple.root.user-initiated-qos.cooperative, QoS: 25 Backtrace: 4 - 0x000000010194c990 $s2-15QuickFilterViewC17setupDataProvider33_3BC73FA94A44BE3EA584C545F2DC59D8LLyyFyAC_AA0bcD5ModelVtcfU_ + 148 5 - 0x000000010142e98c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xtctRld__ClFyxSg_xtcfU_ + 260 6 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 7 - 0x00000001016eed8c $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_yAA011QuickFilterfR0VXEfU_ + 468 8 - 0x00000001016ef028 $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_yAA011QuickFilterfR0VXEfU_TA + 24 9 libswiftCore.dylib 0x000000018bc4cb28 $s-3mapyqd__Sgqd__xKXEKlF + 240 10 - 0x00000001016ee9f4 $s2-18MapLeftSideBarViewC17setupDataProvider33_D6FB7D27D55F357A3610CADAEC5C7916LLyyFyAC_AA0bcdeF5ModelVtcfU_ + 340 11 - 0x000000010142e98c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xtctRld__ClFyxSg_xtcfU_ + 260 12 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 13 - 0x00000001012c0848 $s2-23ChargeMapViewControllerC25setupControlsDataProvider33_58472D5868F9565E69FB409C08E8552CLLyyFyAC_AA0bcgD5ModelVSgAGtcfU_ + 724 14 - 0x000000010142ef1c $s2-12DataProviderC02onB7Changed6update_yqd___yqd___xSgxtctRld__ClFyAF_xtcfU_ + 268 15 - 0x000000010142dff0 $s2-12DataProviderC03setB0_12notifyChangeyxSg_SbtF + 604 16 - 0x0000000101275a6c $s2-20ChargeMapCoordinatorC06updatebC17ControlsViewModel33_BB8275D347CF8DBB28DF3D51E2C14140LLyyFyyYaYbcfU_TY2_ + 292 17 libswift_Concurrency.dylib 0x00000001ae37f438 _ZN5swift34runJobInEstablishedExecutorContextEPNS_3JobE + 336 18 libswift_Concurrency.dylib 0x00000001ae3800b0 _ZL17swift_job_runImplPN5swift3JobENS_11ExecutorRefE + 80 19 libdispatch.dylib 0x00000001133f0fb4 _dispatch_continuation_pop + 152 20 libdispatch.dylib 0x00000001133f0190 _dispatch_async_redirect_invoke + 904 21 libdispatch.dylib 0x00000001134028ac _dispatch_root_queue_drain + 440 22 libdispatch.dylib 0x000000011340353c _dispatch_worker_thread2 + 248 23 libsystem_pthread.dylib 0x00000001126777d8 _pthread_wqthread + 224 24 libsystem_pthread.dylib 0x00000001126765d4 start_wqthread + 8 2024-03-13 11:58:17.943323+0300 LS[70892:468501] 10.22.1 - [GULReachability][I-REA902004] Network status has changed. Code:2, status:Connected 2024-03-13 11:58:17.944170+0300 LS[70892:468501] 10.22.1 - [FirebaseAnalytics][I-ACS023081] Analytics is disabled. User property not set 2024-03-13 11:58:17.945784+0300 LS[70892:468064] [Process] 0x134068100 - [PID=70896] WebProcessProxy::didBecomeUnresponsive: 2024-03-13 11:58:17.945857+0300 LS[70892:468064] [Process] 0x13904aa18 - [pageProxyID=6, webPageID=7, PID=70896] WebPageProxy::processDidBecomeUnresponsive: 2024-03-13 11:58:17.947074+0300 LS[70892:468064] [Airship] [D] AirshipCore/SessionTracker.swift didBecomeActiveNotification() [Line 119] Application did become active.

rlepinski commented 6 months ago

How are you calling configure

bilalmarifet commented 6 months ago

in AppDelegate configure function calls like service.configure(in: environment, launchOptions: launchOptions ?? [:])

bilalmarifet commented 6 months ago

it's my fault while doing implementation i will close