Post

Replies

Boosts

Views

Activity

Reply to Error when debugging: Cannot create Swift scratch context
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.
Jun ’20
Reply to Error when debugging: Cannot create Swift scratch context
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
Jun ’20
Reply to Error when debugging: Cannot create Swift scratch context
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.
Jul ’20