XCode 9 failed to build : Dyld error message Image not found - cocoapods

On XCode 9, I'm not able to build my project, with this error :
KVNProgress Group/Users/xxx/Documents/project/Pods/KVNProgress/KVNProgress/Resources/KVNProgressView.xib
/Users/xxx/development/project/Pods/KVNProgress/KVNProgress/Resources/KVNProgressView.xib: Internal error. Please file a bug at bugreport.apple.com and attach "/var/folders/kb/3qmqmk_569v9ggc23nnc5btm0000gn/T/IB-agent-diagnostics_2018-02-16_10-30-34_345000".
Crash detail :
Process: Interface Builder Cocoa Touch Tool [10066]
Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/Interface Builder Cocoa Touch Tool
Identifier: Interface Builder Cocoa Touch Tool
Version: 9.2 (13772)
Code Type: X86-64 (Native)
Parent Process: ibtoold [10050]
Responsible: Interface Builder Cocoa Touch Tool [10066]
User ID: 262
Date/Time: 2018-02-15 14:33:28.445 +0100
OS Version: Mac OS X 10.12.6 (16G1114)
Report Version: 12
Anonymous UUID: C68970F4-1365-1C3A-554B-396EA6A954FC
Time Awake Since Boot: 1800 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks DYLD_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/PrivateFrameworks
Library not loaded: /System/Library/PrivateFrameworks/CoreAnalytics.framework/CoreAnalytics
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/WirelessDiagnostics.framework/WirelessDiagnostics
Reason: image not found
I tried a lot of solutions from Reason: no suitable image found. but I still have the problem.
Important precision : On my other mac, the project build correctly.
Before yesterday, project build on this mac...
I tried to delete and recreate all the Provisioning profile and Certificates, to delete XCode cash, remove project and recreate from git and install pod again, restart mac, clean derived data, but nothing works...
Other precision : I'm not able to build another project with KVNProgress lib.

Turns out Avast quarantined the file that was missing.
Restored the file and Xcode worked fine

Related

XCode 10.2.1 crashes while trying to open (xcode quits unexpectedly while using the libMainThreadChecker.dylib plug-in)

When I try to open Xcode, it crashes unexpectedly and asks me to reopen. But reopening also gives me the same error. I have XCode 10.2.1 as well as XCode 11.7 installed.
Problem details and system configuration:
Process: Xcode [1607]
Path: /Applications/Xcode1.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 10.2.1 (14490.122)
Build Info: IDEFrameworks-14490122000000000~6 (10E1001)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [1607]
User ID: 501
PlugIn Path: /Applications/Xcode1.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
PlugIn Identifier: libMainThreadChecker.dylib
PlugIn Version: ??? (64490.34)
Date/Time: 2020-11-16 21:23:39.623 -0500
OS Version: macOS 11.0.1 (20B29)
Report Version: 12
Bridge OS Version: 5.0.1 (18P2561)
Anonymous UUID: 14ACF447-0D96-DDDB-DD2C-2FE0B3DB664D
Time Awake Since Boot: 4800 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fff237919b9
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Bus error: 10
Termination Reason: Namespace SIGNAL, Code 0xa
Terminating Process: exc handler [1607]
VM Regions Near 0x7fff237919b9:
__TEXT 7fff22bf8000-7fff23600000 [ 10.0M] r-x/r-x SM=COW /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
--> __TEXT 7fff23600000-7fff23800000 [ 2048K] r-x/rwx SM=COW /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
Submap 7fff23800000-7fff40000000 [456.0M] r--/rwx SM=PRV process-only VM submap
Application-Specific Information:
/Applications/Xcode1.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib
ProductBuildVersion: 10E1001
Faced the same issue on Big Sur update. Git stopped working as well. Fixed it by running following command in terminal.
defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1
Original Answer Reference: https://developer.apple.com/forums/thread/651985?answerId=637934022#637934022
Faced the same issue after updating to Big Sur.
Found a temporary workaround:
Go to Xcode10.app/Contents/Developer/usr/lib
Rename the file libMainThreadChecker.dylib into anything else (I named it _libMainThreadChecker.dylib)
NOTE: If your project has "Main thread checker enabled" it may crash somewhere, so it's better to disable it.
This is a known issues
Currently there is one workaround for this.
You've to run the following command in the Terminal app to avoid crashes when starting Xcode:
defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker 1
Now deactivate "Main Thread Checker" in your Xcode project: Edit
Scheme -> Run/Test -> Diagnostics -> Uncheck Main Thread Checker.

Xcode quit unexpectedly when opening my project

I tried to delete the 2 files in the projects package content and if I do that my project works but when I click on any file it quits again
log:
Process: Xcode [515]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.4 (7720)
Build Info: IDEFrameworks-7720000000000000~8
App Item ID: 497799835
App External ID: 812725084
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [515]
User ID: 501
Date/Time: 2015-08-04 12:34:07.199 +0300
OS Version: Mac OS X 10.10.4 (14E46)
Report Version: 11
Anonymous UUID: 93354AAB-2902-3F8B-27E6-05F9AFC1C64D
Time Awake Since Boot: 580 seconds
Crashed Thread: 14 Dispatch queue: IBPlatformToolRequestQueue.IBCocoaTouchFramework-EightAndLater
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Whenever this has happened to me, i keep Xcode closed and delete DerivedData folder. This is located at /Users/username/Library/Developer/Xcode/DerivedData
Deleting Derived data and clearing cache helps
you can clear derived data by pressing CMD+, in xcode and select locations then click the little gray arrow beneath Derived data and select the derived data folder and just select and trash
You can clear cache by pressing CMD+k

XCode crashes when running Unity project in Simulator

Running XCode 6.1.1 and Unity 4.6.1 (free version)
I edited the Unity-Generated Xcode project so that Base SDK is "iOS 8.1", and Supported Platforms is "iOS". Other than that, it is the same. Each time I run the project, XCode asks me if I want the app to accept incoming Network Connections (really annoying btw), and then XCode implodes with the below, about a Code Signature being invalid with lldb. I can't imagine I'm the only one out there with this issue, but Google has not helped me out with finding others with this issue. So... not sure what's happening here.
Process: Xcode [9062]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 6.1.1 (6611)
Build Info: IDEFrameworks-6611000000000000~4
App Item ID: 497799835
App External ID: 810788292
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Xcode [9062]
User ID: 501
PlugIn Path: /Users/gregory/Library/Developer/CoreSimulator/Devices/4763D685-8069-492C-AACD-210671E5A7DD/data/Containers/Bundle/Application/D574563E-8038-4C30-B88B-0FF3B1AF96F1/LaserLarry.app/LaserLarry
PlugIn Identifier: ca.crescentdevelopment.LaserLarry
PlugIn Version: 1.0 (1.0)
Date/Time: 2015-01-27 12:05:28.662 -0800
OS Version: Mac OS X 10.10.1 (14B25)
Report Version: 11
Anonymous UUID: D4619ABC-7D43-9E17-7C12-7ECEBAE0D4CA
Sleep/Wake UUID: 2F24D97F-F4B6-42EC-BFE3-110FF9BA4544
Time Awake Since Boot: 59000 seconds
Crashed Thread: 24 <lldb.process.internal-state(pid=9138)>
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x000000011b5fa000
kernel messages:
-1 sec CODE SIGNING: cs_invalid_page(0x11b5fa000): p=9062[Xcode] final status 0x3000200, denying page sending SIGKILL
-1 sec CODE SIGNING: process 9062[Xcode]: rejecting invalid page at address 0x11b5fa000 from offset 0xed4000 in file "/Users/USER/Library/Developer/CoreSimulator/Devices/4763D685-8069-492C-AACD-210671E5A7DD/data/Containers/Bundle/Application/D574563E-8038-4C30-B88B-0FF3B1AF96F1/LaserLarry.app/LaserLarry" (cs_mtime:1422389070.0 == mtime:1422389070.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0)

cloudKit and Mac OS X unable to run app with no errors (EXC_CRASH)

I working on mac version of app my app using cloudkit. The iOS version works fine but when tried to export the app for distribution (testing) I got this error:
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
kernel messages:
VM Regions Near 0x7fff786870a8 (cr2):
__LINKEDIT 00007fff68a32000-00007fff68a46000 [ 80K] r--/rwx SM=COW /usr/lib/dyld
--> Submap 00007fff70000000-00007fff80000000 [256.0M] r--/rwx SM=PRV process-only VM submap
unused shlib __DATA 00007fff76c7d000-00007fff7920c000 [ 37.6M] rw-/rw- SM=COW system shared lib __DATA not used by this process
When I disable the app Sandbox and iCloud entitlements I don't get that error but I get this error:
Crashed Thread: 4 Dispatch queue: NSOperationQueue 0x600000227760 :: NSOperation 0x6080000948c0 (QOS: USER_INITIATED)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to establish valid container/bundleID information'
terminating with uncaught exception of type NSException
I'm kind lost of what can be wrong with the app. If I ran the app from xcode it works just fine.
UPDATE:
If I do the following:
Archive -> Export... -> Export as Mac Application
Works but is pointing to cloudkit sandbox environment.
If I try to:
Archive ->Export .. -> Save for mac app store deployment I still get the same error:
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
I have configure xcode with all the provision profiles (development,distribution)
The following are the code signing configuration in xcode:
But if I Archice ->Validate for the mac app store the result is "validation successful" but if I submit to the mac app store I get this warning signs next to the build number:
I'll really appreciate your help to resolve this issue.
Without sandbox and CloudKit entitlement, this could not work. This feature is bound to the sandbox and Mac Appstore Apps only.
And with this active, you can only create an app for Mac Appstore Deployment with a valid certificate and all testing devices in the provisioning profile (as known from iOS).
I found out, there are two ways for getting the correct signed test binary:
Archive -> Export... -> Export as Mac Application
Archive -> Export... -> Save for Mac App Store Deployment
You can't build a Installer Package nor a Developer ID-signed Application with this features.
UPDATE: removed second option, seems not to work correctly

Running cocoa application outside Xcode

When I'm running my cocoa application inside Xcode it works fine.
But I'm going to where the .app file is and run it from there this error shows up:
Process: QBLoader [4571]
Path: /Users/USER/Library/Developer/Xcode/DerivedData/QBLoader-egxdvwlbzueazygfdbjqcxtgyvqz/Build/Products/Debug/QBLoader.app/Contents/MacOS/QBLoader
Identifier: com.fsm.QBLoader
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: launchd [210]
Date/Time: 2012-05-25 09:25:31.121 +0200
OS Version: Mac OS X 10.7.3 (11D50)
Report Version: 9
Interval Since Last Report: 62057 sec
Crashes Since Last Report: 10
Per-App Interval Since Last Report: 20 sec
Per-App Crashes Since Last Report: 10
Anonymous UUID: 5DEC6815-69C3-48FA-A3C4-3EEBC31CC1B6
Crashed Thread: 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: /Library/Frameworks/SBJson.framework/Versions/A/SBJson
Referenced from: /Users/USER/Library/Developer/Xcode/DerivedData/QBLoader-egxdvwlbzueazygfdbjqcxtgyvqz/Build/Products/Debug/QBLoader.app/Contents/MacOS/QBLoader
Reason: image not found
This is what worked for me.
I changed "Installation directory" for the SBJson target to: "#executable_path/../Frameworks".
Now is it possible to run the application outside Xcode.

Resources