App crashes in Testflight immediately after splash screen but not in Expo - ios

I can't get my app to work in Testflight after upgrading from Expo SDK 44 (expo build) to SDK 47 with EAS. So far, I got the app working in Expo. But when I build with EAS and try to run it, it crashes after the splash screen.
Crash log mentions EXUpdatesErrorRecovery.m but a search on the internet so far only learned me it can be anything.
Trace
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 2
Last Exception Backtrace:
0 CoreFoundation 0x18da4de88 __exceptionPreprocess + 164 (NSException.m:202)
1 libobjc.A.dylib 0x186d838d8 objc_exception_throw + 60 (objc-exception.mm:356)
2 MetarTaf 0x102d8b3bc -[EXUpdatesAppController throwException:] + 24 (EXUpdatesAppController.m:485)
3 MetarTaf 0x102d9cbd8 -[EXUpdatesErrorRecovery _crash] + 768 (EXUpdatesErrorRecovery.m:268)
4 MetarTaf 0x102d9c420 -[EXUpdatesErrorRecovery _runNextTask] + 200 (EXUpdatesErrorRecovery.m:184)
5 libdispatch.dylib 0x19501c4b4 _dispatch_call_block_and_release + 32 (init.c:1518)
6 libdispatch.dylib 0x19501dfdc _dispatch_client_callout + 20 (object.m:560)
7 libdispatch.dylib 0x195025694 _dispatch_lane_serial_drain + 672 (inline_internal.h:2632)
8 libdispatch.dylib 0x1950261e0 _dispatch_lane_invoke + 384 (queue.c:3940)
9 libdispatch.dylib 0x195030e10 _dispatch_workloop_worker_thread + 652 (queue.c:6846)
10 libsystem_pthread.dylib 0x1daaa3df8 _pthread_wqthread + 288 (pthread.c:2618)
11 libsystem_pthread.dylib 0x1daaa3b98 start_wqthread + 8 (:-1)
Hardware used (iPhone 13)
Incident Identifier: A562E67E-ABF6-4196-B5DD-ACED79363679
Hardware Model: iPhone14,5
Process: -- [16963]
Path: --
Identifier: --
Version: 2.4.0 (2.4.5)
AppStoreTools: 14C17
AppVariant: 1:iPhone14,5:16
Beta: YES
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: -- [2764]
Date/Time: 2023-01-28 11:53:14.2711 +0100
Launch Time: 2023-01-28 11:53:13.6737 +0100
OS Version: iPhone OS 16.1.1 (20B101)
Release Type: User
Baseband Version: 2.12.02
Report Version: 104
Packages.json
.. "dependencies": {
"#react-native-async-storage/async-storage": "~1.17.3",
"#react-native-clipboard/clipboard": "^1.11.1",
"#react-navigation/material-bottom-tabs": "^6.2.11",
"#react-navigation/material-top-tabs": "^6.5.2",
"#react-navigation/native-stack": "^6.9.8",
"deprecated-react-native-prop-types": "^4.0.0",
"expo": "^47.0.0",
"expo-application": "~5.0.1",
"expo-constants": "~14.0.2",
"expo-device": "~5.0.0",
"expo-file-system": "~15.1.1",
"expo-font": "~11.0.1",
"expo-linking": "~3.3.0",
"expo-localization": "~14.0.0",
"expo-location": "~15.0.1",
"expo-notifications": "~0.17.0",
"expo-speech": "~11.0.0",
"expo-status-bar": "~1.4.2",
"expo-store-review": "~6.0.0",
"expo-system-ui": "~2.0.1",
"expo-updates": "~0.15.6",
"react": "18.1.0",
"react-dom": "18.1.0",
"react-native": "0.70.5",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.8.0",
"react-native-pager-view": "6.0.1",
"react-native-paper": "^4.12.5",
"react-native-popup-menu": "^0.15.13",
"react-native-root-toast": "^3.3.1",
"react-native-safe-area-context": "4.4.1",
"react-native-screens": "~3.18.0",
"react-native-stack": "^1.0.0-alpha11",
"react-native-svg": "13.4.0",
"react-native-swipeable": "^0.6.0",
"react-native-tab-view": "^3.3.4",
"react-native-vector-icons": "^9.2.0",
"react-native-web": "~0.18.7",
"react-native-webview": "11.23.1",
"react-navigation": "^4.4.4" }, "devDependencies": {
"#babel/core": "^7.19.3",
"typescript": "^4.6.3" }, ..
UPDATE:
When the crash occurs, I find some errors in the XCode console that I have already solved in my local environment.
To do so, I had to hack into node_modules for react-native-swipeable and react-native itself, per the instructions listed here: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'
Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
Unhandled JS Exception: Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'.
..
Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
It seems that EAS is trying to build the application with a different node_modules directory.
Hope anyone can help me with it.

EAS maintains its own copy of node_modules. So altering scripts in local node_modules will have no effect for the production build.
Both the react-native package (0.70.5) and react-native-swipeable (0.6.0) are not properly maintained and don't work as they are released. They still use ViewPropTypes that have been dropped from React Native. There is a workaround by using the deprecated-react-native-prop-types package.
To use the deprecated proptypes package, you need to manually alter node_modules. But those changes aren't sent to EAS.
Patch-package takes care of that, by replaying changes you made on the server-side as well.
Per its documentation I installed patch-package (see https://www.npmjs.com/package/patch-package). First added the post-install hook in app.json:
"scripts": {
+ "postinstall": "patch-package"
}
Then I installed the npm package:
npm i patch-package
Next I registered the patched packages:
npx patch-package react-native
npx patch-package react-native-swipeable
And started a new EAS build with clear cache, to be sure:
eas build -p ios --clear-cache
You can check the Expo > Build Details > Prebuild to see if the patches are applied remotely:
- Config syncing
✔ Config synced
Running "npm install" in the root dir of your repository
> metartaf#2.4.0 postinstall
> patch-package
patch-package 6.5.1
Applying patches...
react-native#0.70.5 ✔
react-native-swipeable#0.6.0 ✔
added 8 packages, and audited 1331 packages in 2s
83 packages are looking for funding
run `npm fund` for details
9 high severity vulnerabilities
Hope this helps anyone with the same issue.

Any how you need to implement the patches.
In my case there were the four libraries I added the patches for all of them and it works for me.

Related

I cant run my react native app after send to test flight

I'm developing an application with react native and I recently published it on the test flight for my beta testers to use the application, but now I need to continue developing but when I run
react-native run-ios
the application is installed on the emulator but the error appears:
Could not connect to development server.
Ensure the following:
Node server is running and available on the same network - run 'npm start' from react-native root
Node server URL is correctly set in AppDelegate
WiFi is enabled and connected to the same network as the Node Server
URL: http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=br.com.W2App
RCT Fatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_yes
0x0
0x0
In the output log in the terminal appears:
2022-12-23 16:16:32.957 xcodebuild[44831:5288964] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x13bb0fc60: name:Docs.docc path:group:Docs.docc> Failed to load container at path : /Users/goattech/Library/Developer/Xcode/DerivedData/W2App-bcybuxjmeijubwcppznzxbonxojg/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
2022-12-23 16:16:38.199 xcodebuild[44831:5290006] Requested but did not find extension point with identifier Xcode.InterfaceBuilderBuildSupport.PlatformDefinition
info Installing "/Users/goattech/Library/Developer/Xcode/DerivedData/W2App-bcybuxjmeijubwcppznzxbonxojg/Build/Products/Debug-iphonesimulator/W2App.app"
info Launching "br.com.W2App"
success Successfully launched the app on the simulator
✨ Done in 111.36s.
I already changed the ios scheme from release to debug back but that didn't help, I need to run the app in development mode inside the IOS emulator

iOS Build Crash after upgrade from 0.60.4 to 0.62.2

I recently upgraded my react-native project from 0.60.4 to 0.62.2. I added all the dependencies and resolved all the errors thrown in terminal one by one and I was successfully able to compile the project. Now when I run the build in XCode the app crashes with following log in XCode:
2020-04-16 16:25:50.635 [error][tid:com.facebook.react.JavaScript] TypeError: undefined is not an object (evaluating 'R.ART.Shape')
2020-04-16 16:25:50.641 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'R.ART.Shape')
2020-04-16 16:25:50.642 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
2020-04-16 16:25:50.686677+0530 MY_APP[14817:106507] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'R.ART.Shape')', reason: 'Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'R.ART.Shape'), stack:
<unknown>#875:258
v#2:1473
<unknown>#874:228
v#2:1473
<unknown>#873:242
v#2:1473
<unknown>#872:150
v#2:1473
<unknown>#870:228
v#2:1473
<unknown>#868:342
v#2:1473
<unknown>#394:471
v#2:1473
<unknown>#6:70
v#2:1473
d#2:875
global code#1220:3
'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c4601bb __exceptionPreprocess + 331
1 libobjc.A.dylib 0x000000010a846735 objc_exception_throw + 48
2 MY_APP 0x0000000106f0426a RCTFormatError + 0
3 MY_APP 0x0000000106f876fc -[RCTExceptionsManager reportFatal:stack:exceptionId:suppressRedBox:] + 519
4 MY_APP 0x0000000106f88197 -[RCTExceptionsManager reportException:] + 1669
5 CoreFoundation 0x000000010c46703c __invoking___ + 140
6 CoreFoundation 0x000000010c4644d5 -[NSInvocation invoke] + 325
7 CoreFoundation 0x000000010c464926 -[NSInvocation invokeWithTarget:] + 54
8 MY_APP 0x0000000106f36c51 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 612
9 MY_APP 0x0000000106f39203 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 251
10 MY_APP 0x0000000106f38f85 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
11 libdispatch.dylib 0x000000010e367595 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010e368602 _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010e36fb0b _dispatch_lane_serial_drain + 791
14 libdispatch.dylib 0x000000010e370784 _dispatch_lane_invoke + 428
15 libdispatch.dylib 0x000000010e37a89a _dispatch_workloop_worker_thread + 733
16 libsystem_pthread.dylib 0x000000010e6fd611 _pthread_wqthread + 421
17 libsystem_pthread.dylib 0x000000010e6fd3fd start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
react-native info
System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU # 1.60GHz
Memory: 317.59 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 13.13.0 - /usr/local/bin/node
Yarn: Not Found
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.7.5 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 24, 26, 28
Build Tools: 28.0.3
System Images: android-28 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_73 - /usr/bin/javac
Python: 2.7.10 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Any help would be highly appreciated.
Thanks-in-advance.
After a lot of debugging process finally got the solution.
Actually in the project there was an npm package react-native-pie-chart which has a peer dependency of ART but since ART is now removed from react-native package it was failing. ART is now available as a standalone package '#react-native-community/art'.
So I removed the react-native-pie-chart package and added back using https://github.com/sarmad1995/react-native-pie-chart since the original react-native-pie-chart package is not updated yet and still using ART from react-native.

Flutter: unable to install "Runner" error when trying to install flutter app to real iOS device

I am using iPhone 8 (Version 13.3.1), and a MacBook air (Version 10.14.6). I have set 'team' to personal team in Xcode > general. Then I click the button on the top left corner to run it.
I received error like this even I have deleted the apps that I have installed before on the same phone with the sample apple id:
Details
Unable to install "Runner"
Domain: com.apple.dtdevicekit
Code: -402620383
--
App installation failed
Domain: com.apple.dtdevicekit
Code: -402620383
Failure Reason: The maximum number of apps for free development profiles has been reached.
User Info: {
DVTRadarComponentKey = 487927;
"com.apple.dtdevicekit.stacktrace" = (
0 DTDeviceKitBase 0x00000001263006e7 DTDKCreateNSError + 109
1 DTDeviceKitBase 0x0000000126300de9 DTDK_AMDErrorToNSError + 792
2 DTDeviceKitBase 0x000000012634056a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
3 DVTFoundation 0x000000010ba8dc12 DVTInvokeWithStrongOwnership + 73
4 DTDeviceKitBase 0x0000000126340301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
5 IDEiOSSupportCore 0x00000001261c8a25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
6 DVTFoundation 0x000000010bbbee7a __DVT_CALLING_CLIENT_BLOCK__ + 7
7 DVTFoundation 0x000000010bbc0552 __DVTDispatchAsync_block_invoke + 809
8 libdispatch.dylib 0x00007fff6734f5f8 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x00007fff6735063d _dispatch_client_callout + 8
10 libdispatch.dylib 0x00007fff673568e0 _dispatch_lane_serial_drain + 602
11 libdispatch.dylib 0x00007fff67357396 _dispatch_lane_invoke + 385
12 libdispatch.dylib 0x00007fff6735f6ed _dispatch_workloop_worker_thread + 598
13 libsystem_pthread.dylib 0x00007fff67590611 _pthread_wqthread + 421
14 libsystem_pthread.dylib 0x00007fff675903fd start_wqthread + 13
);
}
--
In Xcode go to Window → Devices under Installed Apps delete some apps, and afterwords you could run your app
Removing the app from the device worked for me.
I fixed it by renaming the bundle ID
The bundle ID it was complaining about had been used in the past on my phone, with a different app, coming from a different TestFlight account and build.
Unable to Install Runner
It's because of the debug App Quantity in your real device. Max 3 apps are able to run from Xcode to your real device for real debugging for further more just uninstall the app. Try to uninstall some of your test app then try to install the new debug app from xcode .Now it will work. Thanks.
Goto Xcode
Runner > General,
Under Identity, Change "Bundle Identifier",
Run app to the real device,
If you want, change the "Bundle Identifier" back to the original one.
I did all 5 steps , and worked perfectly , thanks to Rens.
I simply changed the build number, it worked just fine.
possible ways: (maybe one of them works)
change the build number.
change the team.
delete the app from the phone or from installed apps in window ->
Devices
unplug the usb cable.
change the bundle identifier.
https://stackoverflow.com/a/73597887/13059465
Try changing the lightning cable for another, use a certificate for more security, that's what I did and it worked
I too faced this issue. Removing the app from Window > Devices and Simulators didn't do it for me. What worked was renaming the bundle id. This allowed me to run it again, but I was also able to then rename it back to the original and get it to run.
Deleting the app from the device and removing any uncommitted git changes to the ios files worked for me.

Xcode 9 GM - Export and Upload to App Store crashing

I'm trying to upload my app that uses ARKit (Unity build) to iTunes Connect for TestFlight distribution. While both exporting and uploading to app store processes from Xcode -> Organizer I see crash on "Stripping extended attributes for APPNAME.app".
I checked all configuration of bitcode and symbols on/off, signing automatically, manually. Deployment target of my project is iOS 10, as 11 cannot be set.
I also tried following steps from simillar thread (https://forums.developer.apple.com/thread/83219) and added App Store 1024 icon to Images.xcassets.
Any ideas why Xcode is crashing?
Screenshot from just before the crash:
Crash report:
Process: Xcode [10862]
Path: /Applications/Xcode-9b6.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 9.0 (13238.4)
Build Info: IDEFrameworks-13238004000000000~11
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [10862]
User ID: 501
Date/Time: 2017-09-10 14:56:10.196 +0100
OS Version: Mac OS X 10.12.6 (16G29)
Report Version: 12
Anonymous UUID: FD8390BC-9E7B-969D-15A2-22A8DBBD050D
Time Awake Since Boot: 16000 seconds
System Integrity Protection: enabled
Crashed Thread: 17 Dispatch queue: ConcurrentQueue: -[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
VM Regions Near 0x20:
-->
__TEXT 0000000103625000-0000000103627000 [ 8K] r-x/rwx SM=COW /Applications/Xcode-9b6.app/Contents/MacOS/Xcode
Application Specific Information:
ProductBuildVersion: 9M214v
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fffbb90634a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fffbb905797 mach_msg + 55
2 com.apple.CoreFoundation 0x00007fffa6037434 __CFRunLoopServiceMachPort + 212
3 com.apple.CoreFoundation 0x00007fffa60368c1 __CFRunLoopRun + 1361
4 com.apple.CoreFoundation 0x00007fffa6036114 CFRunLoopRunSpecific + 420
5 com.apple.HIToolbox 0x00007fffa5596ebc RunCurrentEventLoopInMode + 240
6 com.apple.HIToolbox 0x00007fffa5596cf1 ReceiveNextEventCommon + 432
7 com.apple.HIToolbox 0x00007fffa5596b26 _BlockUntilNextEventMatchingListInModeWithFilter + 71
8 com.apple.AppKit 0x00007fffa3b2fa54 _DPSNextEvent + 1120
9 com.apple.AppKit 0x00007fffa42ab7ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796
10 com.apple.dt.DVTKit 0x0000000103eb58be -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 390
11 com.apple.AppKit 0x00007fffa3b243db -[NSApplication run] + 926
12 com.apple.AppKit 0x00007fffa3aeee0e NSApplicationMain + 1237
13 libdyld.dylib 0x00007fffbb7df235 start + 1
Edit
Running xcodebuild (through fastlane gym) produces the following:
+ xcodebuild -exportArchive -exportOptionsPlist /var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/gym_config20170912-61009-190kutb.plist -archivePath '/Users/wert/Library/Developer/Xcode/Archives/2017-09-12/towerar 2017-09-12 22.06.54.xcarchive' -exportPath /var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/gym_output20170912-61009-42bo6w
2017-09-12 22:09:04.966 xcodebuild[62085:5372649] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/z1/m155xvnn42s7xl7hfw3_8w5w0000gn/T/Unity-iPhone_2017-09-12_22-09-04.966.xcdistributionlogs'.
2017-09-12 22:09:21.584 xcodebuild[62085:5372649] [MT] IDEDistribution: Step failed: <IDEDistributionPackagingStep: 0x7fc3c75f18b0>: <IDEDistributionPackagingStep: 0x7fc3c75f18b0>
2017-09-12 22:09:21.584 xcodebuild[62085:5372649] -[__NSCFString userInfo]: unrecognized selector sent to instance 0x7fc3c74d72f0
** INTERNAL ERROR: Uncaught exception **
Uncaught Exception: -[__NSCFString userInfo]: unrecognized selector sent to instance 0x7fc3c74d72f0
Stack:
0 __exceptionPreprocess (in CoreFoundation)
1 objc_exception_throw (in libobjc.A.dylib)
2 -[NSObject(NSObject) doesNotRecognizeSelector:] (in CoreFoundation)
3 ___forwarding___ (in CoreFoundation)
4 _CF_forwarding_prep_0 (in CoreFoundation)
5 __55-[Xcode3CommandLineBuildTool _distributeArchiveAndExit]_block_invoke (in Xcode3Core)
6 -[Xcode3CommandLineBuildTool _distributeArchiveAndExit] (in Xcode3Core)
7 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
8 0x0000000104d752af (in xcodebuild)
9 start (in libdyld.dylib)
I've had to uncheck all checkboxes and use manual managing signing, then it was possible to proceed in the wizard.
Does the xattr command line tool work? It's possible your python installation is damaged, or if you've replaced the installed xattr module then you may need to reinstall the system provided one.
I had been experiencing same frustating problem and it happen almost all day , Xcode 9 suddenly crashes in the middle of the archiving process, resulting in the same error report.
#dangercheng gave me insight about archive process in xcode 9, which is, it needs the xattr command , therefore I go check xattr command in my macbook and somehow xattr doesn't work. From the verbose message, it reveals that the error is related to file permission owned by folders/files inside /Library/Python/2.7 . Somehow a user other than root has no right to write (w/ 2) on those files/folders.
From above facts I concluded that I need to change file permission in this case chmod -R 775 and apply it to all folders and its content on /Library/Python/2.7. After that my xattr is running well and my Archive process in Xcode 9 is running smoothly, experiencing no crash.
Thanks for all of you guys
In my case, it was due to permissions issues with python.
When running xattr from terminal I had the following error:
IOError: [Errno 13] Permission denied: '/Users/cb/Library/Python/2.7/lib/python/site-packages/zc.buildout-1.5.2-py2.7.egg-info/namespace_packages.txt'
Taking a look inside the /Users/cb/Library folder I found that all of the folders were owned by cb:staff (my currently logged in user and group) but the /Users/cb/Library/Python folder was owned by root:wheel
Running the following will eliminate the error:
sudo chown -R $USER:$(id -g) /Users/$USER/Library/Python
After the sudo chown you can run xattr again to verify. There should be no errors or other output from the xattr command.
Probably not your fault but do file a bug with Apple. But when the Xcode uploader fails for any reason try the good ol' Application Loader:
Xcode.app/Contents/Applications/Application Loader.app
run 'xattr' command in mac terminal,if result like bellow:
python version 2.7.10 can't run /usr/bin/xattr. Try the alternative(s):
/usr/bin/xattr-2.6 (uses python 2.6)
/usr/bin/xattr-2.7 (uses python 2.7)
Run "man python" for more information about multiple version support in
Mac OS X.
you should creat a new soft link to '/usr/bin/xattr-2.7'
run bellow commands:
cd /usr/bin
sudo rm xattr
sudo ln -s xattr-2.7 xattr
this solve my problem!
I solved my problem following #dangercheng's answer.
I upgraded my python to python 3.6 two days ago.And it seems that the xattr command was executed under python3.6 .
However, when I execute xattr in terminal.
File "/usr/bin/xattr", line 31
continue
^
TabError: inconsistent use of tabs and spaces in indentation
Something bad happened!
So I edit the source code of xattr.
for i in g:
vers = vpat.search(i)
if vers is None:
continue //add 4 space
sys.stderr.write("%s (uses python %s)\n" % (i, i[vers.start():vers.end()]))
n = 1
```
python version 3.6.3 can't run /usr/bin/xattr. Try the alternative(s):
(Error: no alternatives found)
Run "man python" for more information about multiple version support in
Mac OS X.
```
another error!
I guess the xattr command should judge the version of python and execute suitable codes and the code of python3 contains some error.
Finally I change the default version of python to python2.7 and replace softlink of xattr to xattr-2.7. It works.
Attention, when xcodebuild execute xattr command the path of python was "/usr/bin/python".
The path "/usr/bin/python" was softlink too.
So, I resolved this problem following this step.
Step1:
cd /usr/bin
Step2:
sudo rm python
sudo ln -s python2.7 python
Step3:
sudo rm xattr
sudo ln -s xattr-2.7 xattr
If you can not found python2.7 under "/usr/bin", please find another suitable python path such as "/Library/Frameworks/Python.framework/Versions/2.7" etc.

Xcode crashes when trying to run project due to LLDB

When I click 'Run', Xcode crashes instantly, regardless of my code.
The crash report says that the LLDB plugin can not be read correctly:
Error getting value for key 'workerClass' of extension 'Xcode.DebuggerFoundation.Debugger.LLDB' in plug-in 'com.apple.dt.dbg.DebuggerLLDB'
The crash report:
Process: Xcode [2184]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.0.2 (3335.32)
Build Info: IDEApplication-3335032000000000~4
Code Type: X86-64 (Native)
Parent Process: launchd [147]
Responsible: Xcode [2184]
User ID: 501
Date/Time: 2014-02-26 18:41:28.657 +0100
OS Version: Mac OS X 10.9.2 (13C64)
Report Version: 11
Anonymous UUID: B5F54D76-660F-C9CE-0C9C-D0D41BA7332B
Sleep/Wake UUID: 9A19E5A2-14DE-40FF-8993-668257EF9F44
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
Sending performRunAction: to <IDERunPauseContinueToolbarButton: 0x7f8494673e80> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
ProductBuildVersion: 5A3005
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Error getting value for key 'workerClass' of extension 'Xcode.DebuggerFoundation.Debugger.LLDB' in plug-in 'com.apple.dt.dbg.DebuggerLLDB'
UserInfo: {
NSUnderlyingError = "Error Domain=DVTPlugInErrorDomain Code=2 \"Loading a plug-in failed.\" UserInfo=0x7f8496dca9a0 {DVTPlugInIdentifierErrorKey=com.apple.dt.dbg.DebuggerLLDB, DVTPlugInExecutablePathErrorKey=/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin/Contents/MacOS/DebuggerLLDB, NSLocalizedRecoverySuggestion=The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled., NSLocalizedDescription=Loading a plug-in failed., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin, NSLocalizedFailureReason=The plug-in \U201ccom.apple.dt.dbg.DebuggerLLDB\U201d at path \U201c/Applications/Xcode.app/Contents/PlugIns/DebuggerLLDB.ideplugin\U201d could not be loaded. The plug-in or one of its prerequisite plug-ins may be missing or damaged., NSUnderlyingError=0x7f8496dc98f0 \"The bundle \U201cDebuggerLLDB\U201d couldn\U2019t be loaded because it is damaged or missing necessary resources.\"}";
}
Hints:
0: Sending performRunAction: to <IDERunPauseContinueToolbarButton: 0x7f8494673e80> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
1: Sending performAction: to <DVTDelayedMenuButtonCell: 0x7f8494674490> from <IDERunPauseContinueToolbarButton: 0x7f8494673e80>
Backtrace:
0 0x00007fff91211244 __exceptionPreprocess (in CoreFoundation)
1 0x00000001082ddd73 DVTFailureHintExceptionPreprocessor (in DVTFoundation)
2 0x00007fff940a2e75 objc_exception_throw (in libobjc.A.dylib)
3 0x000000010826bcd2 -[DVTExtension valueForKey:] (in DVTFoundation)
4 0x000000010d3d1109 -[DBGLLDBDebugLocalService operationWorkerWithLaunchSession:error:] (in DebuggerLLDBService)
5 0x0000000110106e17 -[IDERuniPhoneSimulatorService operationWorkerWithLaunchSession:error:] (in IDEiOSSupportCore)
6 0x0000000108d38d49 -[IDERunDestination runWorkerForLaunchSession:error:] (in IDEFoundation)
7 0x0000000108d38a74 -[IDERunDestination runOperationForLaunchSession:error:] (in IDEFoundation)
8 0x0000000108da0fee -[IDELaunchSchemeAction runOperationForExecutionEnvironment:withBuildOperation:buildParameters:buildableProductDirectories:schemeActionRecord:outError:actionCallbackBlock:] (in IDEFoundation)
9 0x0000000108d94f5b -[IDEScheme _executionOperationForExecutionEnvironment:build:onlyBuild:buildPurpose:buildCommand:schemeCommand:title:overridingProperties:destination:buildLog:filePath:overridingBuildConfiguration:restorePersistedBuildResults:invocationRecord:overridingTestingSpecifiers:error:actionCallbackBlock:] (in IDEFoundation)
This may happen due to a broken LLDB debugger, which could only be solved by Apple.
However, I haven't found many similar problems from others on the internet yet, so this may only happen with my Xcode.
I had the same problem: was not able to run any Xcode projects. Reason was I was playing around on Python and downgraded it to 2.6.8 from 2.7.x. So, I have updated the python to 2.7.8 from older version, No problems so far, Xcode deploys everything very smoothly. Other things that I have tried was even uninstalling the X-code and install again, this didn't help. Very useful page to upgrade your python on macbook : http://wolfpaulus.com/jounal/mac/installing_python_osx/
It has nothing to do with your project. Somehow the Xcode.app that you launched has been damaged. Try downloading the latest Xcode from the App Store or ADC.
If this don't helps, try to report your problem: Apple Bug Reporter
If anyone still has the same problem, Apple told me that this happens if a wrong "custom" version of Python is installed. I installed Python 2.7.6 and it worked.

Resources