Can't view Swift expression values in Xcode debug area - swift

I am using Xcode 9.2 and see the below messages in the debug area.
Shared Swift state for MYAPP has developed fatal errors and is being discarded.
REPL definitions and persistent names/types will be lost.
Also, expressions are not showing their values. They always show "invalid expression"
What could be the reason?

Related

SwiftUI :Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

I am new in SwiftUI and I am currently developing my first big application.The program runs successfully in the simulator however the simulator screen is all white and I get the error:
Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
in the AppDelegate(to which I have made no changes)
the app already consists of multiple files , however I can not find any problems in my code however many times I check it. What type of error should I be looking for?
In the context of Swift code,
EXC_BAD_INSTRUCTION
usually means you’ve hit a compiler trap, that is, an undefined instruction inserted into the code by the compiler because of a bug detected at runtime. The most common cause of these are:
failure to unwrap an optional —
This can be a forced unwrap (!) or an implicit unwrap (accessing an implicitly unwrapped optional that’s nil).
array out of bounds
a failed forced cast (as!), either because the value was a nil optional or because the value was of the wrong type
You can debug this issue by creating a exception breakpoint. As the name suggests, this stops the code execution before the execution of the line that throwed this exception.
To Create a exception breakpoint in Xcode, Go to BreakPoint navigator -> Click the + icon at the bottom left corner -> Select Exception Breakpoint.
More about breakpoints check this link

Eclipse conditional breakpoint has compilation errors, in ThreadpoolExecutor

I am trying to put a conditional breakpoint in java.util.concurrent.ThreadPoolExecutor class (say in getTask()) method. I tried multiple conditions, but in all conditions, this as well as other threads keep popping the following error:
"Unable to compile conditional breakpoint - missing java project context".
enter image description here
Could this be happening because ThreadPoolExecutor could have been compiled without debug information?
In any case, are there any other way in which i can break in this class (particularly getTask() method)? Its important for me in order to debug multi threaded application.

Xcode compiler error not highlighted in editor

Xcode has started displaying a compiler error as soon as I open my project (i.e. a build is not required) but it's all a bit odd. One error is shown in the build time tab but when I open the compiler message window there are three identical errors spread across multiple files. The errors are not highlighted in the editor window so I can't trace them but as they're flagged in files I haven't touched recently I suspected the problem was with Xcode rather than my code.
The error is shown in the build time window as:
Swift Compiler Error - cannot convert value of type '()' to closure result type 'Observable<Void>'
In the messages window:
<unknown>:0: error: cannot convert value of type '()' to closure result type 'Observable<Void>'
These errors are spread across three files in the messages window, all of which use at least one RxSwift dependency (RxDataSources, RxSwift, and RxCocoa) and, as noted above, I haven't touched a couple of them for a week or two and my dependencies have not been recently amended so I can be reasonably certain they are not the issue.
I've done all the usual (clean, clear cache, reboot, checked error display settings, roll back to an earlier version, update dependencies, reinstall Xcode) but the error persists and I'm effectively locked out of further development until I can resolve it. To say that I'm frustrated would be an understatement!
I'm running Xcode 10.2.1 (10E1001)
Help!!
I took the app apart and then added in each class individually until the error popped up again. The problem was a typo (syntax error) in a view model struct, specifically, the line:
let editTapped = CocoaAction { return }
which should have been:
let editTapped = CocoaAction {
// do stuff
return .empty()
}
I'm guessing the failure of the compiler to highlight the error in the editor pane is a bug so I'll report it (unless anyone has views to the contrary?) as it was very time consuming to sort out. The odd things was that rolling back to a previous working version didn't fix it - I had to delete the entire app and then rebuild it from scratch manually adding the files as I went. Weird...

Silence "unknown OID 17227: failed to recognize type of 'geography'. It will be treated as String."

I'm using columns of type "geography" for some few "point within polygon" queries. They are too few and too simple to bundle a GIS gem, I handle it all on the SQL level.
However, every time Rails boots (rake tasks, console etc), the following warning is spit:
unknown OID 17227: failed to recognize type of 'geography'. It will be treated as String.
I'm fine with "geography" being treated as "String", but the warning triggers warning mails every time a cronjob executes any rake task.
Any idea how I can silence this warning?
Thanks for your hints!
Looking at the source of ActiveRecord, I can answer the question myself:
The warning is hardcoded and therefore can't be silenced by AR configuration. However, RUBYOPT=-W0 gets rid of warnings altogether. This is a big chopper of course, but since I'm still getting those warnings in local development, I can live with a totally warning-less production system.
Since this is the first question/answer that appears given that the title is the error, I would recommend following this answer to fix it: What is the source of "unknown OID" errors in Rails?

symbolicate line number exactly in swift closure?

Is possible to get line number of crash exactly when error is in a swift closure ?
I can't get line number exactly when I re-symbolicate device log or using crash report on firebase, I can just know it happens on which closure,
what I miss ?
I'm sorry it is not possible
Your code doesn't exist in the compiled binary because the compiler changes your code code to optimise it in Release.
The solution is to use crash tools (See Crashlytics) or throw out NSLog()