iOS Release App crashes on Launch "Unable to get pid for label" - ios

Disclaimer: I am not using Expo.
react: 16.8.3
react-native: 0.59.9
react-native-cli: 2.0.1
iOS 12.2 (16E227)
I have this weird problem with my React Native iOS app that has been happening for a while. At a first glance everything works as excepted, both Development and Release. I am able to install it in my device and use it without the metro server running.
However after some time, like couple of days the app in my phone won't launch, it crashes at the launch screen, the one that says "Powered by React Native ..." with the following errors showing up in the console:
Process: assertiond
Failed to start job with error <NSError: 0x103e56f70; domain: NSPOSIXErrorDomain; code: 3; reason: "No such process"> {
description = "Unable to get pid for label UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62]";
failureReason = "No such process";
userInfo = {
BKLaunchdJobLabel = UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62];
BKLaunchdOperation = launch_get_running_pid_4SB;
}
}
Process: SpringBoard
[org.josemigallas.RealmsCounter] Bootstrap failed with error: <NSError: 0x2830c26a0; domain: BKSProcessErrorDomain; code: 1 (bootstrap-failed); reason: "Failed to start job">
Process: SpringBoard
Bootstrapping failed for <FBApplicationProcess: 0x1371b5470; org.josemigallas.RealmsCounter; pid: -1> with error: Error Domain=BKSProcessErrorDomain Code=1 "Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter" UserInfo={NSLocalizedDescription=Unable to bootstrap process with bundleID org.josemigallas.RealmsCounter, BKSProcessExitReason=0, NSLocalizedFailureReason=Failed to start job, NSUnderlyingError=0x2830c0210 {Error Domain=NSPOSIXErrorDomain Code=3 "No such process" UserInfo={BKLaunchdOperation=launch_get_running_pid_4SB, NSLocalizedDescription=Unable to get pid for label UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], BKLaunchdJobLabel=UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], NSLocalizedFailureReason=No such process}}, BKSProcessJobLabel=UIKitApplication:org.josemigallas.RealmsCounter[0x953c][62], BSErrorCodeDescription=bootstrap-failed}
Is this a bug? Or did I do something wrong with the Xcode configuration? The React Native documentation is of no use Xcode wise and so is iOS's because this is something in between of both.
Any ideas?

OK, turned out it as simple as the provisioning profile is only valid for 6 days without a paid Apple Developer account... The app will work during the first days then inevitably it won't start anymore and it has to be rebuild again.

Related

App failed to launch on Xcode after build successfully

I'm trying to launch the application on a real device from Xcode, but after building correctly the app doesn't launch.
The error is the following:
Unable to launch bundle.identifier Domain: com.apple.platform.iphoneos
Code: -12
-- Request to launch "bundle.identifier" failed. Domain: com.apple.dt.deviceprocesscontrolservice Code: 2 Failure Reason: The
operation couldn’t be completed. Application info provider
(FBSApplicationLibrary) returned nil for "bundle.identifier" : Failed
to launch process with bundle identifier 'bundle.identifier'.
-- The operation couldn’t be completed. Application info provider (FBSApplicationLibrary) returned nil for "bundle.identifier" Domain:
FBSOpenApplicationErrorDomain Code: 4 Failure Reason: Application info
provider (FBSApplicationLibrary) returned nil for "bundle.identifier"
User Info: {
BSErrorCodeDescription = NotFound; }
It started giving me this error when i changed bundle identifier to the application. I also tried to change the bundle identifier directly from info.plist and not only from project > Targets but the error persists.

Error when trying to upload image using react-native-webview v11.0.2 in a simulator iPhone 11 on xCode 12.4

When trying to upload an image to a web system, using webview in react-native v0.63.2 and react-native-webview v11.0.2 on an iPhone 11 emulator using iOS 14, I get the error on the xCode console:
2021-02-11 19:07:33.784921-0300 Ebank[2851:26809] [ProcessSuspension] 0x111cac210 - ProcessAssertion: Failed to acquire RBS UnboundedNetworking assertion 'WebKit uploads' for process with PID 2860, error: Error Domain=RBSAssertionErrorDomain Code=3 "Required client entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"UnboundedNetworking" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Required client entitlement is missing}
Emulating on Android, the upload happens normally. Any idea what it might be?
Thank you all.

app created through expo-cli crashing on ios real device

After I executed 'xattr -cr path/to/your.app' command ,app got installed in simulator. but its crashing in the real device.
crash report:
error: Error Domain=BKSProcessErrorDomain Code=1
"Unable to bootstrap process with bundleID com.aq.FOGVERSION2"
UserInfo={
NSLocalizedDescription=Unable to bootstrap process with bundleID com.aq.FOGVERSION2,
BKSProcessExitReason=0,
NSLocalizedFailureReason=Failed to start job,
NSUnderlyingError=0x282299320
{Error Domain=NSPOSIXErrorDomain Code=3
"No such process"
UserInfo={NSLocalizedFailureReason=The process failed to exec, NSLocalizedRecoverySuggestion=Consult /var/log/com.apple.xpc.launchd/launchd.log
for more information, NSLocalizedDescription=Unable to get valid task name port right for pid 2019}},
`BSErrorCodeDescription`=bootstrap-failed}
can you help me to fix it?

Xcode executes successful build but is unable to launch on a physical device

I'm having this exact same issue:
https://github.com/facebook/react-native/issues/26152
This is on react-native 0.60.4
I'm able to have a successful build in Xcode, but I'm not able launch the app on a physical device.
This is the error that I'm given:
This is the readout from the console:
Details
Unable to launch com.news.arg
Domain: com.apple.platform.iphoneos
Code: -12
--
Request to launch com.news.arg failed.
Domain: com.apple.dt.deviceprocesscontrolservice
Code: 2
Failure Reason: The operation couldn’t be completed. Application "com.news.arg" is unknown to FrontBoard. : Failed to launch process with bundle identifier 'com.news.arg'.
--
The operation couldn’t be completed. Application "com.news.arg" is unknown to FrontBoard.
Domain: FBSOpenApplicationErrorDomain
Code: 4
Failure Reason: Application "com.news.arg" is unknown to FrontBoard.
User Info: {
BSErrorCodeDescription = NotFound;
}
--
Someone said on the react native reddit that expo posted a workaround on their twitter, but we were unable to find it when we went back and looked.

Testing Failed when build using Xcode build command or appium

I am using :
Xcode 10.1
Os Version : 12.1
iPhone 6
I did follow all required steps to setup build and everything but still getting error when try to build project using xcode build.
I am confuse between 2 thing that is it signing issue or I am missing some config. in webdriver agent xproj.
Actual Error on xcode build command
Testing failed:
WebDriverAgentRunner-Runner.app encountered an error (Failed to install or launch the test runner. (Underlying error: Unable to launch com.apple.test.WebDriverAgentRunner-Runner. (Underlying error: The operation couldn’t be completed. (DTXMessage error 1.))))
Actual Error on appium
Error: Unable to launch WebDriverAgent because of xcodebuild failure: “xcodebuild failed with code 65”. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
Some other logs if that helps :
2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}
2018-11-19 11:02:17.350 xcodebuild[2413:325556] Error Domain=IDETestOperationsObserverErrorDomain Code=4 “Failed to install or launch the test runner” UserInfo={NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/asianweb/Library/Developer/Xcode/DerivedData/WebDriverAgent-dikkwtrisltbeobjmfvpthwwekvs/Logs/Test/Test-WebDriverAgentRunner-2018.11.19_11-02-01-+0530.xcresult, NSLocalizedDescription=Failed to install or launch the test runner, NSUnderlyingError=0x7f8ec7ac6c70 {Error Domain=com.apple.platform.iphoneos Code=-12 “Unable to launch com.apple.test.WebDriverAgentRunner-Runner” UserInfo={NSLocalizedDescription=Unable to launch com.apple.test.WebDriverAgentRunner-Runner, NSUnderlyingError=0x7f8ec758be20 {Error Domain=DTXMessage Code=1 “(null)” UserInfo={DTXExceptionKey=The operation couldn’t be completed. Unable to launch com.apple.test.WebDriverAgentRunner-Runner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. : Failed to launch process with bundle identifier ‘com.apple.test.WebDriverAgentRunner-Runner’}}}}}
Other logs info
{
deviceSerialNumber: XXXXXXXXXXXX
identifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
deviceClass: iPhone
deviceName: qa’s iPhone
deviceIdentifier: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6
productVersion: 12.1
buildVersion: 16B92
deviceSoftwareVersion: 12.1 (16B92)
deviceArchitecture: arm64
deviceTotalCapacity: 11945508864
deviceAvailableCapacity: 5477302272
deviceIsTransient: NO
ignored: NO
deviceIsBusy: NO
deviceIsPaired: YES
deviceIsActivated: YES
deviceActivationState: Activated
isPasscodeLocked: NO
deviceType: <DVTDeviceType:0x8f7ec4d00ca0 Xcode.DeviceType.iPhone>
supportedDeviceFamilies: (
1
)
applications: (null)
provisioningProfiles: (null)
hasInternalSupport: NO
isSupportedOS: YES
developerDiskMountError: (null)
(null)
bootArgs: (null)
connected: yes
isWirelessEnabled: no
connectionType: direct
hostname: (null)
bonjourServiceName: 90:60:f1:6b:7f:91#fe80::9760:f1ff:fe6b:2f92._apple-mobdev2._tcp.local.
} (12.1 (16B92))
Note : While I run it, it puts my app and webdriveragent into iphone device and then stopped.
I was able to resolve issue by following steps :
Uninstalled following :
Xcode,Appium,Xcode command line,ideviceinstaller,carthage,xpretty,deviceconsole
Reinstalled everything as per this video guide : https://youtu.be/ySglJIrDVMQ
Restart my mac machine and iphone
Again setup project in xcode as per this video guide : https://youtu.be/ySglJIrDVMQ
And Yes it works.
For iOS development I use Fastlane with the XCTest framework and I had the same problem as you described. However, I'm using a simulator, not a real device. To solve it I replaced iPhone 6 with iPhone XS Max in the list of simulators that should be used for testing. If you can also use any other device different from iPhone 6 you should try this solution.
However if you need to test your application on iPhone 6 you can recreate the corresponding simulator. In Xcode 10.1 press Window -> Devices and Simulators, then select the line called iPhone 6 and press Backspace. After that press + in the left bottom corner of window to create a new simulator. You will see this window:
Set all parameters as they are in this screenshot and then press Create. After that, try to run your test suite again.

Resources