others-how to solve `Target is not running or required target entitlement is missing` error when trying to build iOS app in xcode ?

1. Problem

When we try to build our iOS app in xcode, we got this error:

2022-05-02 14:49:22.713750+0800 bswenReceiver1[42318:2626507] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed
2022-05-02 14:49:22.744039+0800 bswenReceiver1[42318:2626424] [Firebase/Crashlytics] Version 7.1.0
Create table ok
delete too old msges ok
Permission granted: true
Notification settings: <UNNotificationSettings: 0x600000b9df80; authorizationStatus: Authorized, notificationCenterSetting: Enabled, soundSetting: Enabled, badgeSetting: Enabled, lockScreenSetting: Enabled, carPlaySetting: NotSupported, announcementSetting: NotSupported, criticalAlertSetting: NotSupported, alertSetting: Enabled, alertStyle: Banner, groupingSetting: Default providesAppNotificationSettings: No>
sceneWillEnterForeground
2022-05-02 14:49:22.951699+0800 bswenReceiver1[42318:2626424] <Google> To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ kGADSimulatorID ];
2022-05-02 14:49:22.961400+0800 bswenReceiver1[42318:2626522] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.961644+0800 bswenReceiver1[42318:2626522] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.961838+0800 bswenReceiver1[42318:2626521] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.962571+0800 bswenReceiver1[42318:2626521] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.962637+0800 bswenReceiver1[42318:2626522] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.963288+0800 bswenReceiver1[42318:2626521] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2022-05-02 14:49:22.963316+0800 bswenReceiver1[42318:2626522] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
viewWillAppear
start query Messages from server ...
querying server with ["lastHash": "", "userName": "11812345678", "devicePasswd": "12345678", "requestTime": 1651474163143, "lastDate": "", "latestReadTime": 0, "unReadCount": 0, "deviceId": "test_device_id", "requestID": "1651474163143"]
2022-05-02 14:49:23.166875+0800 bswenReceiver1[42318:2626424] [Warning] Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a table view cell's content view. We're considering the collapse unintentional and using standard height instead. Cell: <UITableViewCell: 0x7f827fc172f0; frame = (0 109.333; 390 44); clipsToBounds = YES; autoresize = W; layer = <CALayer: 0x6000020bba00>>
2022-05-02 14:49:23.238354+0800 bswenReceiver1[42318:2626424] WF: === Starting WebFilter logging for process bswenReceiver1
2022-05-02 14:49:23.238834+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:49:23.263512+0800 bswenReceiver1[42318:2626424] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600002015380> F8BB1C28-BAE8-11D6-9C31-00039315CD46
sceneDidBecomeActive
Failed to register: Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator}
2022-05-02 14:49:23.674768+0800 bswenReceiver1[42318:2626506] 7.1.0 - [Firebase/Analytics][I-ACS025028] AdMob and Firebase are in use in this app, but are not linked. For analytics data consistency and integrity, it is highly recommended that you link your AdMob app to the corresponding Firebase app and re-download the GoogleServices-Info.plist file. See https://support.google.com/admob/answer/6383165 for more information.
2022-05-02 14:49:23.716909+0800 bswenReceiver1[42318:2626506] 7.1.0 - [Firebase/Analytics][I-ACS025026] Deferring to Firebase for event data collection
2022-05-02 14:49:23.755581+0800 bswenReceiver1[42318:2626506] 7.1.0 - [Firebase/Analytics][I-ACS023007] Analytics v.7.1.0 started
2022-05-02 14:49:23.792963+0800 bswenReceiver1[42318:2626506] 7.1.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
got http response <NSHTTPURLResponse: 0x600002036200> { URL: https://www.bswensms.com/testinterfaceapp/testinterface/msg/q } { Status Code: 200, Headers {
    Connection =     (
        "keep-alive"
    );
    "Content-Type" =     (
        "application/json;charset=UTF-8"
    );
    Date =     (
        "Mon, 02 May 2022 06:49:24 GMT"
    );
    Server =     (
        nginx
    );
    "Strict-Transport-Security" =     (
        "max-age=15768000"
    );
    "Transfer-Encoding" =     (
        Identity
    );
} }
got data 46 bytes
[Crashlytics] The signal SIGABRT has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGBUS has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGFPE has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGILL has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGSEGV has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGSYS has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
[Crashlytics] The signal SIGTRAP has a non-Crashlytics handler (GADRegisterSignalHandlers).  This will interfere with reporting.
2022-05-02 14:49:24.805266+0800 bswenReceiver1[42318:2626736] 7.1.0 - [Firebase/Crashlytics][I-CLS000000] Warning: NSUncaughtExceptionHandler is 'GADRegisterExceptionHandler' in '/Users/bswen/Library/Developer/CoreSimulator/Devices/5C548134-7CC1-4B06-BBDB-3FB7AF1B0773/data/Containers/Bundle/Application/5868939F-FFD3-4D42-9FBD-68E01DE6A452/bswenReceiver1.app/bswenReceiver1'
2022-05-02 14:49:25.059069+0800 bswenReceiver1[42318:2626506] 7.1.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
2022-05-02 14:49:27.255985+0800 bswenReceiver1[42318:2626522] 7.1.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
2022-05-02 14:49:27.258578+0800 bswenReceiver1[42318:2626522] 7.1.0 - [Firebase/Analytics][I-ACS023220] Analytics screen reporting is enabled. Call +[FIRAnalytics logEventWithName:FIREventScreenView parameters:] to log a screen view event. To disable automatic screen reporting, set the flag FirebaseAutomaticScreenReportingEnabled to NO (boolean) in the Info.plist
2022-05-02 14:49:27.605286+0800 bswenReceiver1[42318:2626536] <Google> <Google:HTML> You are currently using version 8.4.0 of the SDK. Please consider updating your SDK to the most recent SDK version (9.3.0) to get the latest features and bug fixes. The latest SDK can be downloaded from https://goo.gl/UoiJ8F. A full list of release notes is available at https://developers.google.com/admob/ios/rel-notes.
2022-05-02 14:49:29.219844+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:49:29.321107+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:50:15.730439+0800 bswenReceiver1[42318:2626424] CoreText note: Client requested name ".PingFangSC-Regular", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[UIFont systemFontOfSize:].
2022-05-02 14:50:15.730638+0800 bswenReceiver1[42318:2626424] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
viewWillAppear
start query Messages from server ...
querying server with ["requestID": "1651474220253", "latestReadTime": 0, "devicePasswd": "12345678", "deviceId": "test_device_id", "lastHash": "", "lastDate": "", "unReadCount": 0, "requestTime": 1651474220253, "userName": "11812345678"]
got http response <NSHTTPURLResponse: 0x600002044540> { URL: https://www.bswensms.com/testinterfaceapp/testinterface/msg/q } { Status Code: 200, Headers {
    Connection =     (
        "keep-alive"
    );
    "Content-Type" =     (
        "application/json;charset=UTF-8"
    );
    Date =     (
        "Mon, 02 May 2022 06:50:20 GMT"
    );
    Server =     (
        nginx
    );
    "Strict-Transport-Security" =     (
        "max-age=15768000"
    );
    "Transfer-Encoding" =     (
        Identity
    );
} }
got data 46 bytes
2022-05-02 14:50:50.424405+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:50:50.542928+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:50:50.908936+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:50:50.909065+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bfe980 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42354, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:51:20.857804+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 14:51:20.946003+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
section: 2 row: 1
viewWillAppear
start query Messages from server ...
querying server with ["deviceId": "test_device_id", "requestTime": 1651474308641, "lastHash": "", "unReadCount": 0, "userName": "11812345678", "latestReadTime": 0, "requestID": "1651474308641", "devicePasswd": "12345678", "lastDate": ""]
got http response <NSHTTPURLResponse: 0x60000203ebe0> { URL: https://www.bswensms.com/testinterfaceapp/testinterface/msg/q } { Status Code: 200, Headers {
    Connection =     (
        "keep-alive"
    );
    "Content-Type" =     (
        "application/json;charset=UTF-8"
    );
    Date =     (
        "Mon, 02 May 2022 06:51:48 GMT"
    );
    Server =     (
        nginx
    );
    "Strict-Transport-Security" =     (
        "max-age=15768000"
    );
    "Transfer-Encoding" =     (
        Identity
    );
} }
got data 46 bytes
viewWillAppear
start query Messages from server ...
querying server with ["deviceId": "test_device_id", "requestID": "1651474327735", "lastHash": "", "latestReadTime": 0, "requestTime": 1651474327735, "unReadCount": 0, "lastDate": "", "devicePasswd": "12345678", "userName": "11812345678"]
got http response <NSHTTPURLResponse: 0x6000020cb100> { URL: https://www.bswensms.com/testinterfaceapp/testinterface/msg/q } { Status Code: 200, Headers {
    Connection =     (
        "keep-alive"
    );
    "Content-Type" =     (
        "application/json;charset=UTF-8"
    );
    Date =     (
        "Mon, 02 May 2022 06:52:07 GMT"
    );
    Server =     (
        nginx
    );
    "Strict-Transport-Security" =     (
        "max-age=15768000"
    );
    "Transfer-Encoding" =     (
        Identity
    );
} }
got data 46 bytes
section 0 row 0
loading messages view, mode UN_READS
loading...
messages loaded 0
settings clicked
2022-05-02 14:52:10.204804+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:53:11.834740+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:53:12.254631+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:53:12.254757+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103b772c0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42449, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:53:42.217051+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 14:54:23.625394+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:54:24.093745+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:54:24.093874+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bfec40 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42494, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:54:54.049308+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 14:55:35.577940+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:55:35.954949+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:55:35.955101+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bbe900 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42526, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:56:05.914118+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 14:56:47.145211+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:56:47.549797+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:56:47.549936+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bbe0c0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42670, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:57:17.532403+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
settings clicked
2022-05-02 14:57:58.926178+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:57:59.322030+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:57:59.322166+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bbe9c0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42705, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:58:29.284461+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 14:59:10.797112+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 14:59:11.331666+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 14:59:11.331780+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bbea40 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42730, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 14:59:41.296768+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 15:00:22.656592+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 15:00:23.042597+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 15:00:23.042739+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bfeec0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42759, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 15:00:52.997794+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 15:01:34.381658+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 15:01:34.765845+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 15:01:34.765980+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103b80940 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 42822, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 15:02:04.726518+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 15:02:45.956772+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 15:02:46.285873+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 15:02:46.286003+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103bfebc0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 43056, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 15:03:16.243465+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2022-05-02 15:03:57.471136+0800 bswenReceiver1[42318:2626424] WF: _WebFilterIsActive returning: NO
2022-05-02 15:03:57.976503+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 15:03:57.976669+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103b24400 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 43113, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 15:04:27.932582+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

The key error message is:

2022-05-02 15:03:57.976503+0800 bswenReceiver1[42318:2626424] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-05-02 15:03:57.976669+0800 bswenReceiver1[42318:2626424] [ProcessSuspension] 0x103b24400 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 43113, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-05-02 15:04:27.932582+0800 bswenReceiver1[42318:2626424] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service



2. Solution

  • 2.1 Open your xcode – choose preferences – choose manage certificates – click to create new certificate and download manual profile

  • 2.2 Edit schema , add env :
    • From Xcode menu open: Product > Scheme > Edit Scheme
    • On your Environment Variables set OS_ACTIVITY_MODE = disable
  • 2.3 restart xcode

What is OS_ACTIVITY_MODE?

In libdispatch 442.1.4, the OS_ACTIVITY_MODE variable is read in _voucher_init to determine a value of an internal variable; _voucher_init is in turn called in libdispatch_init, which is called only once at program startup. Interestingly, I cannot find this code in later versions of the library; perhaps it has been moved somewhere else. But it doesn’t really matter; the same principle applies. Setting the value of an environment variable will usually have no effect on already-initialised code, and can only be used to influence child processes.

When you set OS_ACTIVITY_MODE to disable, you disable all log outputs for processes that have access to this environment variable, for example the simulators.When you set the value to either info or debug it enables the corresponding logging mode unless it is disabled in the logging preferences for certain log categories.So in order to enable only a certain log category, you have to enable OS_ACTIVITY_MODE, that is, set it either to info or debug or leave it at the default, and then disable logging for all other categories.



3. Summary

In this post, I demonstrated how to solve Target is not running or required target entitlement is missing error when trying to build iOS app in xcode. That’s it, thanks for your reading.