In Xcode 10.1 I had a productive, working development setup. I had a single workspace containing a framework with three targets (macOS, iOS, tvOS), 5 app projects with three targets each (likewise, all using the framework), and a group containing 9 macOS playgrounds that successfully imported the framework and allowed easy unit testing/experimentation with the framework. The framework targets all had same Product Name so I didn't have to use #if os(...) at the top of every file to import platform-specific module names.
When I upgraded to Xcode 10.2, none of the playgrounds worked at all. The "import MyFramework" statement at the top triggered an error: "Could not find module 'MyFramework' for architecture 'x86_64'; found arm64". However, yesterday's 10.2.1 release fixed that problem.
With Xcode 10.2.1, now most of these playgrounds just generate an error but give me no pointer to the offending code, just "expression failed to parse, unknown error" in Xcode's Console pane, and a little drop-down strip at the top of the source editor window stating "The playground could not continue running because the playground source did not compile successfully."
There is one playground that works. The major differentiator with this one is that the code is only exercising (and displaying in the live view) the SpriteKit-based part of my framework, where the others are exercising the SceneKit-based parts (including a SpriteKit-based overlay).
So, the one working playground suggests that the problem isn't accessing my framework, but maybe something in my framework's codepath that touches SceneKit has something to do with it. But the 5 apps using the framework with SceneKit are working fine.
I'm just hoping there's a log somewhere, or some environment variables I could try setting that might help me get a clue as to what is going wrong in the playgrounds.
I noticed in the Xcode 10.2.1 release notes the following known issue that might possibly be related:
In some cases, compilation may fail without emitting a specific error. (49303574)
- Workaround: Disable batch mode by adding the
custom build setting and setting it toSWIFT_ENABLE_BATCH_MODE
. If you’re invokingNO
directly, includeswift
on the command line.-disable-batch-mode
But I don't understand how to add a custom build setting to a playground.
Thanks in advance for any help.
-Andy