Post

Replies

Boosts

Views

Activity

macOS app crashes on first launch from TestFlight
2024_06_09_testflight_launch_crash_log.txt Running my macOS app the first time after installing via TestFlight crashes on launch. Every subsequent run works fine (including completely quitting the app and re-running it). Also, building and running directly in XCode both in Debug and Release mode works fine. I'm on a Mac M2 and the app excludes x86_64 arch. Here is the trimmed crash log (sanitised full log is attached) Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: CamHero-macOS-v2-Release [12876] Application Specific Information: abort() called Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x18c81d11c __pthread_kill + 8 1 libsystem_pthread.dylib 0x18c854cc0 pthread_kill + 288 2 libsystem_c.dylib 0x18c764a40 abort + 180 3 libglib-2.0.0.dylib 0x1061e5bd0 g_assertion_message + 464 4 libglib-2.0.0.dylib 0x1061e5c44 g_assertion_message_expr + 116 5 libgstlibav.dylib 0x10549ede0 gst_ffmpeg_cfg_init + 776 6 libgstlibav.dylib 0x10548a4f4 plugin_init + 140 7 libgstreamer-1.0.0.dylib 0x10646a458 gst_plugin_register_func + 636 8 libgstreamer-1.0.0.dylib 0x106469fe4 gst_plugin_register_static + 212 9 libgstlibav.dylib 0x10548a45c gst_plugin_libav_register + 92 10 CamHero-macOS-v2-Release 0x104a01624 gst_ios_init + 900 (gst_ios_init.m:1072) 11 CamHero-macOS-v2-Release 0x104a80590 specialized CamHeroMacOSApp.init() + 68 (CamHeroMacOSApp.swift:19) 12 CamHero-macOS-v2-Release 0x104a804a4 CamHeroMacOSApp.init() + 4 [inlined] 13 CamHero-macOS-v2-Release 0x104a804a4 protocol witness for App.init() in conformance CamHeroMacOSApp + 20 (<compiler-generated>:16) 14 SwiftUI 0x1b7f134e0 0x1b7163000 + 14353632 15 CamHero-macOS-v2-Release 0x104a804d8 static CamHeroMacOSApp.$main() + 24 [inlined] 16 CamHero-macOS-v2-Release 0x104a804d8 main + 36 17 dyld 0x18c4d90e0 start + 2360 Thread 1: 0 libsystem_pthread.dylib 0x18c84fe28 start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x18c84fe28 start_wqthread + 0 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000 x4: 0x0000600000755680 x5: 0x0000000000000020 x6: 0x0000600000755680 x7: 0xffffffff00008600 x8: 0x8ddd1ea266cd729b x9: 0x8ddd1ea3846d2c5b x10: 0x0000000000001620 x11: 0x00000000dbe367fb x12: 0x00000000000007fb x13: 0x00000000000007fd x14: 0x00000000dc03683c x15: 0x000000000000003c x16: 0x0000000000000148 x17: 0x00000001eb9f3da0 x18: 0x0000000000000000 x19: 0x0000000000000006 x20: 0x00000001e2a05ec0 x21: 0x0000000000000103 x22: 0x00000001e2a05fa0 x23: 0x000000016b407508 x24: 0x0000000000000000 x25: 0x00000001064f8450 x26: 0x000060000080d511 x27: 0x0000000000000000 x28: 0x0000000000000000 fp: 0x000000016b407460 lr: 0x000000018c854cc0 sp: 0x000000016b407440 pc: 0x000000018c81d11c cpsr: 0x40001000 far: 0x0000000000000000 esr: 0x56000080 Address size fault It seems that the initialisation of one of the gstreamer plug-ins doesn't go well. But, I wonder what might lead to that happening only the first time after launch? Will appreciate any clues! EDIT / UPDATE: If i remove the app completely and install the same version again from TestFlight, app doesn't crash. So it seems the crashing is limited to the very first launch of a new /updated version.
3
0
652
Jun ’24
Archiving my macOS target app fails with BOOL error
I'm building a macOS target for my App (which also has some Obj-C code). Building and running the app is fine but when I archive the app in XCode, the process / build fails with the following error Type 'BOOL' (aka ;Int32') cannot be used as a boolean;test for '!=0' instead It happens in a couple of places, one of the places being private func getRootDirectory(createIfNotExists: Bool = true) throws -> URL { return try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true) } where it complains that create: true is not acceptable and throws the above error. If I comment out this line, the archive works successfully. When i Cmd + click the definition of Filemanager.default.url , i get this @available(macOS 10.6, *) open func url(for directory: FileManager.SearchPathDirectory, in domain: FileManager.SearchPathDomainMask, appropriateFor url: URL?, create shouldCreate: BOOL) throws -> URL This looks fishy since it it says create shouldCreate: BOOL whereas the documentation says it should be just Bool func url( for directory: FileManager.SearchPathDirectory, in domain: FileManager.SearchPathDomainMask, appropriateFor url: URL?, create shouldCreate: Bool ) throws -> URL My minimum deployment target is macOS 13.0 I'm quite stumped at this error - which happens only while archiving. Does anybody know why?
4
0
613
Jun ’24
My App build and run on actual device and simulator but fails to archive
Hello everyone! I'm quite new to App development (but have quite a bit of programming experience). I have reached the point where I would like to Archive my app for release but I'm stumped at an issue where the app compiles, builds and runs just fine in XCode on device and simulator targets however fails when I want to archive the app. My app ends up using a mix of a lot of things possible: Swift and SwiftUI Obj-C and some vanilla C, mainly because I use a framework in C Very minimal but some UIKit (that bridges with some parts in C) Here is the stacktrace, would appreciate some insights 1. Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) 2. Compiling with the current language version 3. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for CamHero) 4. While running pass #12497 SILModuleTransform "PerformanceSILLinker". 5. While deserializing SIL function "$s7SwiftUI11EnvironmentV12wrappedValuexvg" 6. While deserializing SIL function "os_log_type_enabled" 7. *** DESERIALIZATION FAILURE *** *** If any module named here was modified in the SDK, please delete the *** *** new swiftmodule files from the SDK and keep only swiftinterfaces. *** module 'SwiftUI', builder version '5.9.2(5.9.2)/Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)', built from swiftinterface, resilient, loaded from '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/prebuilt-modules/17.2/SwiftUI.swiftmodule/arm64-apple-ios.swiftmodule' result not found (isEnabled) Cross-reference to module 'os' ... OSLog ... in an extension in module 'os' ... isEnabled ... with type (OSLog) -&amp;gt; (OSLogType) -&amp;gt; Bool Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): 0 swift-frontend 0x0000000103a11abc llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;amp;, int) + 56 1 swift-frontend 0x0000000106677cb0 llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x00000001063e1054 SignalHandler(int) + 352 3 libsystem_platform.dylib 0x00000001895b3a24 _sigtramp + 56 4 libsystem_pthread.dylib 0x0000000189584cc0 pthread_kill + 288 5 libsystem_c.dylib 0x0000000189494a40 abort + 180 6 swift-frontend 0x0000000102bd7c2c (anonymous namespace)::ParsedAttrInfoFallThrough::~ParsedAttrInfoFallThrough() + 0 7 swift-frontend 0x0000000104470db8 std::__1::__function::__func&amp;lt;swift::evaluator::PerRequestReferences swift::evaluator::PerRequestReferences::makeEmpty&amp;lt;swift::LookupPrefixOperatorRequest&amp;gt;()::'lambda'(void*), std::__1::allocator&amp;lt;swift::evaluator::PerRequestReferences swift::evaluator::PerRequestReferences::makeEmpty&amp;lt;swift::LookupPrefixOperatorRequest&amp;gt;()::'lambda'(void*)&amp;gt;, void (void*)&amp;gt;::operator()(void*&amp;amp;&amp;amp;) + 0 8 swift-frontend 0x0000000102b2c534 swift::ModuleFile::fatal(llvm::Error) const + 44 9 swift-frontend 0x00000001044721dc swift::CyclicalRequestError&amp;lt;swift::LookupPrefixOperatorRequest&amp;gt;::~CyclicalRequestError() + 0 10 swift-frontend 0x00000001045bb880 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt&amp;lt;unsigned int, 31&amp;gt;, swift::SILFunction*, llvm::StringRef, bool, bool) + 1588 11 swift-frontend 0x0000000102bb0f50 swift::SILDeserializer::getFuncForReference(llvm::StringRef, swift::SILType) + 504 12 swift-frontend 0x00000001045cb578 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBuilder&amp;amp;, unsigned int, llvm::SmallVectorImpl&amp;lt;unsigned long long&amp;gt;&amp;amp;) + 29524 13 swift-frontend 0x00000001045bc554 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt&amp;lt;unsigned int, 31&amp;gt;, swift::SILFunction*, llvm::StringRef, bool, bool) + 4872 14 swift-frontend 0x00000001045d6934 swift::SILDeserializer::lookupSILFunction(swift::SILFunction*, bool) + 636 15 swift-frontend 0x0000000102c4d990 swift::SILLinkerVisitor::deserializeAndPushToWorklist(swift::SILFunction*) + 88 16 swift-frontend 0x0000000102c4dfb0 swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 248 17 swift-frontend 0x0000000103c60fa4 (anonymous namespace)::SILLinker::run() (.llvm.15023899450236721039) + 136 18 swift-frontend 0x0000000106018874 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&amp;amp;) + 16276 19 swift-frontend 0x00000001061c21c4 swift::SimpleRequest&amp;lt;swift::ExecuteSILPipelineRequest, std::__1::tuple&amp;lt;&amp;gt; (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1&amp;gt;::evaluateRequest(swift::ExecuteSILPipelineRequest const&amp;amp;, swift::Evaluator&amp;amp;) + 56 20 swift-frontend 0x00000001060646b8 llvm::Expected&amp;lt;swift::ExecuteSILPipelineRequest::OutputType&amp;gt; swift::Evaluator::getResultUncached&amp;lt;swift::ExecuteSILPipelineRequest&amp;gt;(swift::ExecuteSILPipelineRequest const&amp;amp;) + 476 21 swift-frontend 0x000000010607c424 swift::runSILOptimizationPasses(swift::SILModule&amp;amp;) + 472 22 swift-frontend 0x000000010400c3c0 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 572 23 swift-frontend 0x0000000105f59454 performCompileStepsPostSILGen(swift::CompilerInstance&amp;amp;, std::__1::unique_ptr&amp;lt;swift::SILModule, std::__1::default_delete&amp;lt;swift::SILModule&amp;gt;&amp;gt;, llvm::PointerUnion&amp;lt;swift::ModuleDecl*, swift::SourceFile*&amp;gt;, swift::PrimarySpecificPaths const&amp;amp;, int&amp;amp;, swift::FrontendObserver*) + 956 24 swift-frontend 0x0000000105f54f00 performCompile(swift::CompilerInstance&amp;amp;, int&amp;amp;, swift::FrontendObserver*) + 3020 25 swift-frontend 0x0000000105f58854 swift::performFrontend(llvm::ArrayRef&amp;lt;char const*&amp;gt;, char const*, void*, swift::FrontendObserver*) + 4568 26 swift-frontend 0x0000000105fbfd44 swift::mainEntry(int, char const**) + 4408 27 dyld 0x00000001892090e0 start + 2360 Command SwiftCompile failed with a nonzero exit code
3
0
1.2k
Jan ’24