FBSOpenApplicationServiceErrorDomain - ios

Got this strange error when running a unit test. It only appears when attaching to the process when testing the target by Xcode. Testing the target without attaching debugger works. Running the test by command line tool also works. Any idea about the reason? Thanks!
DetailsThe request to open "org.cocoapods.UnitTestHost" failed.
Domain: FBSOpenApplicationServiceErrorDomain
Code: 1
Failure Reason: The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified ("null").
User Info: {
BSErrorCodeDescription = RequestDenied;
FBSOpenApplicationRequestID = 0x2594;
}
--
The operation couldn't be completed. (null)
Domain: FBSOpenApplicationErrorDomain
Code: 1
Failure Reason: (null)
User Info: {
BSErrorCodeDescription = Unspecified;
}
--
Some related error messages from the console:
SpringBoard (SpotlightUI) Reply Error on 0x600000857000:Connection interrupted
runningboardd (RunningBoard) failed to get pid for label UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy] : No such process (3)
runningboardd (RunningBoard) Failed to start job for application<org.cocoapods.UnitTestHost>: <NSError: 0x7fa02351ca80; domain: NSPOSIXErrorDomain; code: 3; reason: "No such process"> {
userInfo = {
RBLaunchdOperation = launch_get_running_pid_4SB;
RBLaunchdJobLabel = UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy];
}
}
runningboardd (RunningBoard) Launchd says label UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy] has never exited
runningboardd (RunningBoard) Removing job: <RBLaunchdJob: 0x7fa02491a110; UIKitApplication:org.cocoapods.UnitTestHost[6d75][rb-legacy]>

Check your scheme settings and make sure all empty settings are unchecked. After doing this restart Xcode and simulator. Product menu > Scheme > Edit Scheme > Run > Arguments > Environment Variables
If there is a checkmark there with an empty field next to it, then uncheck it.
Try resetting your simulator
sudo rm -rf /private/tmp/com.apple.CoreSimulator.SimDevice.*
If it doesn't work try to restart the system.

Check Mach-O Type of your app.
Usually this error appears when you try to run Mach-Object with inappropriate type like Dynamic Library/Bundle/Static Library/Relocatable Object File. To solve the issue select Project -> Build Settings. Search Mach-O Type, change type to Executable.

Related

Why error message in debug window: ask with identifier <decode: missing data> is not currently being simulated submit succeeded

Why am I getting this error message in the debug window when I go through the process of simulating expiration of a background task. I put a breakpoint at the line right after the call to submit, where the print statement that prints "submit succeeded" as you see below. I've looked at other posts at Apple Developer Forums and here on stackoverflow. I have tried probably all the answers. I still don't have a solution. When I used Apple's sample ColorFeed Xcode project, it worked the first time as I recall, and then it stopped working. It doesn't work in my project and also in a separate project I created just to test simulating the expiration of a task I submit.
Task with identifier <decode: missing data> is not currently being simulated
let request = BGProcessingTaskRequest(
identifier: BGTaskIdentifiers.processingTaskIdentifier)
request.earliestBeginDate = Date(timeIntervalSinceNow: 3)
do {
try BGTaskScheduler.shared.submit(request)
print("submit succeeded")
} catch {
print("submit failed with catch error:\n\t\(error.localizedDescription)")
}
Here's what the debug window shows:
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateExpirationForTaskWithIdentifier:#"background.processing.task"]
2022-11-02 21:13:14.221109-0500 TrialBackgroundProcessingTask[13301:615495] Simulating expiration for task with identifier background.processing.task
2022-11-02 21:13:14.221675-0500 TrialBackgroundProcessingTask[13301:615495] Task with identifier <decode: missing data> is not currently being simulated

React Native app fails on launch on one iPhone only, bootstrapping failed

We've run into an unusual situation in which an ad-hoc build of our app crashes on one specific user's iPhone (iPhone 12 Pro Max). Other users with the same device have no issue. This device is running the iOS 15 Beta (8, I believe), but so are other devices that work.
The behavior is that the app launches, the splash screen is briefly shown, and then the app disappears. There are no crash logs for the event, but I do see entries in the log that indicate bootstrapping has failed. The error message is a bit inscrutable, so I'm not sure what to look at.
This is all complicated by it not being an actual native app, as it is written using React Native. So debugging is problematic.
Looking at the log below (see the 11:33:43.698190-0400 line), does anyone have a suggestion on what I should look for? Out of 60 testers, this is the only phone with the issue.
default 11:33:43.608231-0400 Spotlight [FBSSystemService][0xe7c9] Sending request to open "com.foo.mobile.thisapp"
default 11:33:43.608625-0400 SpringBoard [FBSystemService][0xe7c9] Received request to open "com.foo.mobile.thisapp" from Spotlight:406.
default 11:33:43.608738-0400 SpringBoard Received trusted open application request for "com.foo.mobile.thisapp" from <FBApplicationProcess: 0x1084c37e0; application<com.apple.Spotlight>:406(v468)>.
default 11:33:43.635600-0400 SpringBoard Executing request: <SBMainWorkspaceTransitionRequest: 0x28344de60; eventLabel: OpenApplication(sceneID:com.foo.mobile.thisapp-default)ForRequester(Spotlight.406); display: Main; source: Spotlight>
default 11:33:43.647737-0400 SpringBoard [FBWorkspaceEvent] Executing: <FBWorkspaceEvent: 0x284665a00; OpenApplication(sceneID:com.foo.mobile.thisapp-default)ForRequester(Spotlight.406)>
default 11:33:43.649306-0400 SpringBoard Asked to bootstrap a new process with identity: application<com.foo.mobile.thisapp>
default 11:33:43.649338-0400 SpringBoard Creating process (sync=true) with identity: application<com.foo.mobile.thisapp>
default 11:33:43.649426-0400 SpringBoard Created <FBWorkspace: 0x283194210; application<com.foo.mobile.thisapp>>
default 11:33:43.649518-0400 SpringBoard Bootstrapping application<com.foo.mobile.thisapp> with intent foreground-interactive
default 11:33:43.650264-0400 SpringBoard [Main] dispatch event:
<SBSceneReadySwitcherModifierEvent: 0x284698320; type: SceneReady; appLayout: <SBAppLayout: 0x281e6c080; primary: com.foo.mobile.thisapp:default; environment: main> {
configuration = full;
environment = main;
layoutItems = {
primary = <SBDisplayItem: 0x2849d13b0> {
type = App;
bundleIdentifier = com.foo.mobile.thisapp;
uniqueIdentifier = sceneID:com.foo.mobile.thisapp-default;
};
}
}>
default 11:33:43.654268-0400 runningboardd Acquiring assertion targeting application<com.foo.mobile.thisapp> from originator [daemon<com.apple.SpringBoard>:67] with description <RBSAssertionDescriptor| "FBApplicationProcess" ID:34-67-63886 target:application<com.foo.mobile.thisapp> attributes:[
<RBSDomainAttribute| domain:"com.apple.frontboard" name:"Bootstrap-Foreground" sourceEnvironment:"(null)">,
<RBSDomainAttribute| domain:"com.apple.frontboard" name:"Visibility" sourceEnvironment:"(null)">
]>
default 11:33:43.654411-0400 runningboardd Assertion 34-67-63886 (target:application<com.foo.mobile.thisapp>) will be created as active
default 11:33:43.654645-0400 runningboardd Executing launch request for application<com.foo.mobile.thisapp> (FBApplicationProcess)
default 11:33:43.654810-0400 runningboardd Creating and launching job for: application<com.foo.mobile.thisapp>
default 11:33:43.654988-0400 runningboardd _mutateContextIfNeeded called for com.foo.mobile.thisapp
default 11:33:43.671674-0400 mediaserverd <<<< FigCaptureDisplayLayoutMonitor >>>> -[FigCaptureDisplayLayoutMonitor _updateCurrentLayout:]: <FBSDisplayLayout: 0x1392c2630; displayIdentity: Main> { bounds = {{0, 0}, {428, 926}}; interfaceOrientation = "portrait (1)"; backlightLevel = 100; elements = { <SBSDisplayLayoutElement: 0x13922f140; com.apple.springboard.spotlight; frame: {{0, 0}, {428, 926}}; level: 0; role: embedded>; <SBSDisplayLayoutElement: 0x139270130; sceneID:com.foo.mobile.thisapp-default; bundleID: com.foo.mobile.thisapp; frame: {{0, 0}, {428, 926}}; level: 1; role: primary>; } timestamp = September 2, 2021 at 11:33:43 AM EDT;}
default 11:33:43.673667-0400 SpringBoard [Main] dispatch event:
<SBTransitionSwitcherModifierEvent: 0x283a3df00; type: MainTransition; transitionID: B611A8E7-B802-4298-8FB7-A9E960141B96; phase: Prepare; animated: YES; fromAppLayout: 0x0; toAppLayout: <SBAppLayout: 0x281e6c080; primary: com.foo.mobile.thisapp:default; environment: main>; fromEnvironmentMode: home-screen; toEnvironmentMode: application; pendingTermination: {(
)}; isSpotlightTransition: YES; dosidoTransitionDirection: 0>
default 11:33:43.697614-0400 runningboardd Invalidating assertion 34-67-63886 (target:application<com.foo.mobile.thisapp>) from originator [daemon<com.apple.SpringBoard>:67]
error 11:33:43.698190-0400 SpringBoard Bootstrapping failed for <FBApplicationProcess: 0x1084e9b50; application<com.foo.mobile.thisapp>:<invalid>> with error: <NSError: 0x28498d350; domain: RBSRequestErrorDomain; code: 5; reason: "Launch failed."> {
NSUnderlyingError = <NSError: 0x28498e2e0; domain: NSPOSIXErrorDomain; code: 85>;
}
default 11:33:43.698318-0400 SpringBoard [application<com.foo.mobile.thisapp>:-1] Now flagged as pending exit for reason: Bootstrap failed
default 11:33:43.698349-0400 SpringBoard [application<com.foo.mobile.thisapp>:-1] Connection to remote process was not established.
Interestingly enough, this appears to be some side effect of compiling with Fastlane and then using Fastlane to upload the artifact. If I archive the project manually and upload it to Firebase, the app works fine on the iPhone in question.

iOS App is stuck at launch screen while Console showing: Attempting to create a breadcrumb action for a scene handle which already has one?

1.After downloading my app from TestFlight and then click it, or run from Xcode directly, the app is stuck on launch screen and cannot continue.
2.When connected with macOS, from the Console we can see some possibly related error in SpringBoard process:
Attempting to create a breadcrumb action for a scene handle which already has one (sceneID:#myAppName#-default). Are you trying to active an app that's already active?
...
[Main] dispatch event:
<SBMainTransitionSwitcherModifierEvent: 0x2837d7dc0; type: MainTransition; transitionID: xxx; phase: Complete; animated: YES; fromAppLayout: 0x0; toAppLayout: <SBAppLayout: 0x281500e80; primary: #myAppName#; environment: main>; fromEnvironmentMode: home-screen; toEnvironmentMode: application; pendingTermination: {(
)}>
The "pendingTermination: {()}" in this log does not appear when app can be launched normally.
And now we cannot see any logs in my app’s process.
3.Then when I lock the screen and unlock it, the iPhone shows nothing but a black background, and I cannot use my iPhone as usual. Here is the logs in the Console:
3.1 Lock screen:
[sceneID:#myAppName#-default] Setting deactivation reasons to: 'appSwitcher, systemAnimation' for reason: updateAllScenesForBand - Assertion added.
[sceneID:#myAppName#-default] Setting deactivation reasons to: 'appSwitcher' for reason: updateAllScenesForBand - Assertion removed.
Invalidating assertion 32-60-106090 (target:[application<#myAppName#>:7754](UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default)) from originator [daemon<com.apple.SpringBoard>:60]
Calculated state for application<#myAppName#>: none (role: UserInteractiveNonFocal)
3.2 Unlock screen:
Acquiring assertion targeting [application<#myAppName#>:7754](UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default) from originator [daemon<com.apple.SpringBoard>:60] with description <RBSAssertionDescriptor| "injecting inherited from "UIScene:com.apple.frontboard.systemappservices::com.apple.springboard" to 7754<UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default>" ID:32-60-106093 target:7754<UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default> attributes:[
<RBSHereditaryGrant| endowmentNamespace:com.apple.boardservices.endpoint-injection UIScene:com.apple.frontboard.systemappservices::com.apple.springboard>,
<RBSHereditaryGrant| endowmentNamespace:com.apple.frontboard.visibility UIScene:com.apple.frontboard.systemappservices::com.apple.springboard>
]>
Assertion 32-60-106093 (target:[application<#myAppName#>:7754](UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default)) will be created as active
Calculated state for application<#myAppName#>: none (role: UserInteractiveNonFocal)
Finished acquiring assertion 32-60-106093 (target:[application<#myAppName#>:7754](UIScene:com.apple.frontboard.systemappservices::sceneID%3A#myAppName#-default))
[sceneID:#myAppName#-default] Setting deactivation reasons to: 'appSwitcher, systemAnimation' for reason: updateAllScenesForBand - Assertion added.
[sceneID:#myAppName#-default] Setting deactivation reasons to: 'appSwitcher' for reason: updateAllScenesForBand - Assertion removed.
4.After rebooting my iPhone, everything return to normal again.
This bug has happened for several times recently, but I have not encounter this kind of issue before.
Is it a bug in SpringBoard? Or it is a bug in my app, and what can I do to fix it?
Thanks.

XCTests failing to launch app in simulator intermittently

Has anyone experienced and fixed:
XCTests are failing intermittently to launch app in the simulator for UI testing (XCUI).
I am running through fastlane, different tests appear to fail each test run.
OSX: 10.12.3
iOS simulator: 10.0
Xcode 8.2.1
Fastlane 2.11.0
Attempted to fix it by adding a 3 second sleep between setup and launch in my tests, but it still appears, maybe not as often but still...
UI Testing Failure - Failure attempting to launch
<XCUIApplicationImpl: 0x600000231b20 no.something.bb.debug at
/Users/server/Library/Developer/Xcode/DerivedData/ex-gmtcdujyggxwfrarizpgaromjfxj/Build/Products/Debug-iphonesimulator/BB.app>:
Error Domain=FBSOpenApplicationServiceErrorDomain Code=1 "The request
to open "no.something.bb.debug" failed."
UserInfo={NSLocalizedDescription=The request to open
"no.something.bb.debug" failed., NSLocalizedFailureReason=The request
was denied by service delegate (SBMainWorkspace) for reason: Busy
("Application "no.something.bb.debug" is installing or uninstalling,
and cannot be launched")., BSErrorCodeDescription=RequestDenied,
NSUnderlyingError=0x6080002598f0 {Error
Domain=FBSOpenApplicationErrorDomain Code=6 "Application
"no.something.bb.debug" is installing or uninstalling, and cannot be
launched." UserInfo={BSErrorCodeDescription=Busy,
NSLocalizedFailureReason=Application "no.something.bb.debug" is
installing or uninstalling, and cannot be launched.}}}
I experienced the same issue. I found out that there is a rader open for this. In the comments I found a tip that I implemented in a function that does a retry.
The arguments array is an array of enum values where the base type is String. I use that for the app arguments.
Unfortunately this is still not full prove. In my case the number of failures went down considerably, but did not go away.
var app: XCUIApplication = XCUIApplication()
public func tryLaunch<T>(_ arguments: [T], _ counter: Int = 10) where T: RawRepresentable {
sleep(3)
XCUIApplication().terminate()
sleep(3)
app = XCUIApplication()
app.launchArguments = arguments.map { $0.rawValue as! String }
app.launch()
sleep(3)
if !app.exists && counter > 0 {
tryLaunch(arguments, counter - 1)
}
}
The function above is included in https://github.com/evermeer/UITestHelper
After playing around we were observed that if we run limited test cases, this error went down considerably. You can find more details at https://blog.talentica.com/2017/04/04/use-xcode-8-with-jenkins/

NSInternalInconsistencyException: bundleURL must be non-nil when not implementing loadSourceForBridge

I recently started to get this error (detailed error below) in my iOS mobile app built using react-native. This only happens when I try to run the app on the phone by using Option 2 which is to load using a static bundle. I have tried:
Clean and rebuild in Xcode
Reset cache and run react packager
Uninstall the app on the phone
Coming from Windows background, I have also tried to reboot my machine
Error in Xcode
2016-08-04 09:34:37.611 GalarmApp[367:165469] *** Assertion failure in
-[RCTBatchedBridge loadSource:](), /Users/abc/Projects/GalarmApp/node_modules/react-native/React/Base/RCTBatchedBridge.m:180 2016-08-04 09:34:37.613 GalarmApp[367:165469] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'bundleURL must be non-nil when not implementing loadSourceForBridge'
*** First throw call stack: (0x182b32db0 0x182197f80 0x182b32c80 0x1834b81c0 0x1000af788 0x1000adefc 0x1000adca4 0x1000e73d8 0x1000e7368 0x1000e6700 0x1000e643c 0x10005a254 0x10003cebc 0x10003c214 0x10003966c 0x100039b18 0x187d069c0 0x187f36184 0x187f3a5f0 0x187f37764 0x1844d37ac 0x1844d3618 0x1844d39c8 0x182ae909c 0x182ae8b30 0x182ae6830 0x182a10c50 0x187cff94c 0x187cfa088 0x10003bee0 0x1825ae8b8) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
I can see that this problem is printed here in the code but I am a beginner at best in native iOS development and don't know how to fix this problem.
Please help me in fixing this problem. Thanks!
Code in AppDelegate.swift file
/**
* Loading JavaScript code - uncomment the one you want.
*
* OPTION 1
* Load from development server. Start the server from the repository root:
*
* $ npm start
*
* To run on device, change `localhost` to the IP address of your computer
* (you can get this by typing `ifconfig` into the terminal and selecting the
* `inet` value under `en0:`) and make sure your computer and iOS device are
* on the same Wi-Fi network.
*/
// let jsCodeLocation = NSURL(string: "http://localhost:8081/index.ios.bundle?platform=ios&dev=true")
/**
* OPTION 2
* Load from pre-bundled file on disk. The static bundle is automatically
* generated by "Bundle React Native code and images" build step.
*/
let jsCodeLocation = NSBundle.mainBundle().URLForResource("main", withExtension: "jsbundle")
As you can see, I have commented out Option 1 and uncommented out 'Option 2`. I have run the same app this way on the device like 100 times. I have not made any changes to the code but all of a sudden I started to see the error above.
Just to add a quick "doh" moment for me. If you're running in the simulator and get this, make sure the package manager is running when you run your app. If it's not, it could complain about this.
You can also get this error if you are not signing the app correctly. Check the Xcode settings and warnings
For my case, I turn on the web proxy settings on my mac which causes the problem. Turning off web proxy settings resolves my problem.

Resources