Xcode 11 debugger crashes on breakpoint, can't find Foundation.h - objective-c

My macOS app compiles and runs fine, but since switching to Xcode 11, I can no longer debug from breakpoints. The debugger always crashes with a bunch of messages like this:
warning: Swift error in scratch context: /foobar/Foo-Bridging-Header.h:14:9: note: in file included from /foobar/Foo-Bridging-Header.h:14:
#import "TPPreciseTimer.h"
^
error: /foobar/Timer/TPPreciseTimer.h:9:9: error: 'Foundation/Foundation.h' file not found
#import <Foundation/Foundation.h>
^
/foobar/Timer/TPPreciseTimer.h:9:9: note: did not find header 'Foundation.h' in framework 'Foundation' (loaded from '/System/Library/Frameworks')
#import <Foundation/Foundation.h>
^
error: failed to import bridging header '/foobar/Foo-Bridging-Header.h'
.
Shared Swift state for Foo has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.
Message from debugger: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
Anyone know a workaround for something like this?
My coworkers still on Xcode 10.3 are not having this issue with the same codebase.

Same here. Removing /Users/{user}/Library/Developer/Xcode/DerivedData directory helped.

Related

Use leveldb-library.framework from firebase for iOS with Xcode9

I would like to be able to use the leveldb-library.framework that google is shipping with their firebase iOS SDK. I don't seem to be able to import the framework.
What I did:
1: copy leveldb-library.framework to project dir
2: in Xcode > Target > Linked Frameworks and Libraries [+] add the framework
3: make sure the header search path it set correctly
4: add a Objective-C++ wrapper class and import the leveldb headers
Getting a linker error:
/Users/ronny/projects/clients/internal/TestCD/TestCD/LevelDB.mm:11:9: fatal error: 'leveldb/db.h' file not found
#import "leveldb/db.h"
^~~~~~~~~~~~~~
1 error generated.
The Headers directory in the framework provides all the headers: db.h, options.h but without the "leveldb" parent directory.
Changing the imports to the following throws the same error:
#import <leveldb/db.h>
#import <leveldb/options.h>
Once I change the imports to this:
#import <leveldb-library/db.h>
#import <leveldb-library/options.h>
the linker is able to find the includes but throws another error:
In file included from /Users/ronny/projects/clients/internal/TestCD/TestCD/LevelDB.mm:11:
/Users/ronny/projects/clients/internal/TestCD/leveldb-library.framework/Headers/db.h:10:10: fatal error: 'leveldb/iterator.h' file not found
#include "leveldb/iterator.h"
^~~~~~~~~~~~~~~~~~~~
1 error generated.
At this point I am no longer sure what can be done in order to resolve this. Adding the import path doesn't help either. Xcode completes the import as such:
Any pointers towards solving this would be greatly appreciated. The project can be found here: https://github.com/ronnyf/TestCD
The framework expects to be called leveldb, but your example calls it leveldb-library.
mv leveldb-library.framework leveldb.framework
mv leveldb.framework/leveldb-library leveldb.framework/leveldb
Update the Xcode project with the renamed framework and it successfully builds.

UI Testing xCode 7.3 - Cannot print variables (i.e 'po app') in the console: (could not build Objective-C module 'Bolts')

I have UI testing project set up and was working perfectly in xCode 7.2. Since I upgraded to xCode 7.3 I cannot print any variables in the console. I set breakpoints in both Application (main project) and UI Test, 'po' command works in the main project but as soon as it reaches UI testing the 'po' command stop working. I have tried almost all the solutions I could find on the internet but still no luck. It complains about the Objective-C module 'Bolts' that I am not using at all in UI testing. Below is how the error message looks like:
(lldb) po app
error: Error in auto-import:
failed to get module 'MyUITestProject' from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/Bolts-umbrella.h"
^
/Users/../Pods/Target Support Files/Bolts/Bolts-umbrella.h:7:9: note: in file included from /Users/../Pods/Target Support Files/Bolts/Bolts- umbrella.h:7:
#import "BFAppLinkReturnToRefererController.h"
^
/Users/../Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h:14:9: error: include of non-modular header inside framework module 'Bolts.BFAppLinkReturnToRefererController'
#import <Bolts/BFAppLinkReturnToRefererView.h>
...
...
Is there anyone run into the same issue? Does anyone knows what cause this failure and any advice?
Delete:
/Users/{User}/Library/Developer/Xcode/DerivedData
and then restart your Xcode.

getting error while programming star tsp650 in objective c

When I add the starIO.framework and try to run my application it says that #include <starmicronics/Platform.h could not be found. I checked the framework to confirm that the file was there and it was dont know why I am getting this error. I even tried to download the framework again and install it again. However it is still coming out to could not be found .
The starmicronics/Platform.h is inside the StarIO.framework..
You have to use #import

how to get DTPerformanceSession working when 'libproc.h file not found'

After adding the line
#import <DTPerformanceSession/DTSignalFlag.h>
I get 'libproc.h file not found'.
This file is not on my mac.
I have tried googling it and it appears is should be included with Xcode.
I have tried upgrading xcode from 4.3 to 4.4 and still the same error.
I am trying to use the following line in my game loop.
DTSendSignalFlag("com.mycompany.mytracepoints.app.point", DT_POINT_SIGNAL, TRUE);
I have included the DTPerformanceSession.framework
Am I missing something?
If you are using for iOS then comment out that line "libproc.h". The flags will appear but on the simulator only not on device. :)

Objective C error messages

I'm trying to debug an objective C program. It used to run, and I'm not sure what changes could have broken it, but it no longer runs at all. In the debugger, I now get:
.
.
.
unable to read unknown load command 0x80000022
unable to read unknown load command 0x80000022
unable to read unknown load command 0x80000022
Program loaded.
sharedlibrary apply-load-rules all
run
Error calling thread_get_state for GP registers for thread 0x16131lx506^error,msg="error on line 207 of \"/SourceCache/gdb/gdb-908/src/gdb/macosx/i386-macosx-nat-exec.c\" in function \"fetch_inferior_registers\": (os/kern) invalid argument (0x4)\n"
I've seen several places that claim te explain the 1st warning, but none of them seem appropriate. Nothing online claims to explain the error.
Any clues as to what these errors mean in conjunction?
ETA: I just upgraded to 10.6, so it may have started then, although I'm compiling to target 10.4...
Is this relevant? From the Xcode release notes:
Note: GCC 4.2 cannot be used with the
Mac OS X 10.4u SDK. If you want to
build targets using the 10.4u SDK on
Xcode 3.2, you must set the Compiler
Version to GCC 4.0