I have the same issue/error in my project.
my project was also failing on the previous Xcode and I had submitted a feedback bug report but never got an answer. (the error was different but referred also to swift context). I will post a new bug report.
My project is public/open source, so I can post the step to reproduce:
git clone https://github.com/roznet/connectstats
pod install
open ConnectStats.xcworkspace
Ctrl-Shift O : to open "GCActivity+Import.swift"
put a break point in the constructor (line 44 for example)
Ctrl-U (run the tests)
you hit the break point, it will print the error and trying to "po var" will fail. note the the variable explorer has the correct value for the variables, only the lldb interactive shell fails.
Post
Replies
Boosts
Views
Activity
Correction my previous post: Command-Sift-O to open the file and Command-U to run the test, (not Ctrl)
Thanks for this. I did as requested (attaching the types.log). Around the LogConfiguration near the error it shows all the search paths, import path, etc up to the same error as in the console Cannot create Swift scratch context (couldn't load the Swift stdlib)
I paste here the list of system path it list (and truncate the path that seem related to my app, but I attached the whole file as well. I am not sure where it's supposed to find the swift stdlib and which path maybe missing/incorrect?
SwiftASTContextForExpressions::LogConfiguration(SwiftASTContext*)0x7ff801a514c0:
	 Architecture								 : x86_64-apple-ios13.5.0-simulator
	 SDK path										 : /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.16.sdk
	 Runtime resource path				: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
	 Runtime library paths				: (2 items)
		 /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
		 /usr/lib/swift
	 Runtime library import paths : (2 items)
		 /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator
		 /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.16.sdk/usr/lib/swift
	 Framework search paths			 : (8 items)
		 /Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Products/Debug-iphonesimulator
		 /Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Products/Debug-iphonesimulator/Flurry-iOS-SDK
		 /Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Products/Debug-iphonesimulator/GenericJSON-iOS
		 /Users/brice/Development/connectstats/Pods/GoogleMaps/Base/Frameworks
		 /Users/brice/Development/connectstats/Pods/GoogleMaps/Maps/Frameworks
		 /Users/brice/Development/connectstats
		 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks
		 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.0.sdk/Developer/Library/Frameworks
	 Import search paths					: (6 items)
		 /Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Products/Debug-iphonesimulator
		 /Users/brice/Development/connectstats/fit-sdk-swift/RZFitFile/sdk
		 /Users/brice/Development/connectstats/fit-sdk-swift/RZFitFile/src
		 /Users/brice/Development/connectstats/fit-sdk-swift/RZFitFile/RZFitFilePrivate
		 /Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Products/Debug-iphonesimulator/GenericJSON-iOS
		 /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib
	 Extra clang arguments				: (85 items)
		 -I/Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Intermediates.noindex/ConnectStats.build/Debug-iphonesimulator/ConnectStats.build/swift-overrides.hmap
		 -I/Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Intermediates.noindex/ConnectStats.build/Debug-iphonesimulator/ConnectStatsXCTests.build/DerivedSources-normal/x86_64
[....]
		 -I/Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Intermediates.noindex/ConnectStats.build/Debug-iphonesimulator/ConnectStatsXCTests.build/DerivedSources/x86_64
		 -I/Users/brice/Library/Developer/Xcode/DerivedData/ConnectStats-cxkmyrvkqnsurebgsrhaudywenlp/Build/Intermediates.noindex/ConnectStats.build/Debug-iphonesimulator/ConnectStatsXCTests.build/DerivedSources
SwiftASTContextForExpressions::() -- Failed to create scratch context - couldn't load the Swift stdlib
full types.log - https://developer.apple.com/forums/content/attachment/87999504-51cd-4626-ab65-cf31671323ba
I have submitted a ticket in feedback assistant with the same title as this thread, and included the types.log as well as the steps to reproduce. The ticket has the id FB7830933
thanks!
thanks.
Yes. the app runs fine, as you mention debugging is a pain, and that's the main reason I am not migrating more of the logic to swift and sticking to Objective C. It makes you appreciate how useful having a debugger is :):)
It could be something in the build settings, but I haven't figure out what....
Just checked Xcode 12 Beta 2 and same error. Same step to reproduce as above.
git clone https://github.com/roznet/connectstats
pod install
open ConnectStats.xcworkspace
Command-Shift O : to open "GCActivity+Import.swift"
put a break point in the constructor (line 44 for example)
Command-U (run the tests)
you then hit the break point, it will print the error and trying to "po var" will fail. note the the variable explorer has the correct value for the variables, only the lldb interactive shell fails.
Xcode beta 3 works for me now...
thanks a lot, appreciate the fix!