Closed buguibu closed 4 years ago
Hi @buguibu, I just tried this with XCode 9.3 on the latest release and am not able to reproduce. Can you attach a stack trace? Thanks.
Hi @mchoe this is strange, so i've just reproduce it again even cleaning derived data and reseting simulator, so more details:
(lldb) po Thread.callStackSymbols SwiftSVG was compiled with optimization - stepping may behave oddly; variables may not be available. 2018-04-12 08:27:53.819799+0200 SwiftSVGExampleiOS[1722:32741] Unrecognized selector -[SwiftSVG.SVGGroup setName:] error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x73757073). The process has been returned to the state before expression evaluation.
Hope it helps!
I have the same problem, but @buguibu I believe that you meant
Build configuration Release or Debug but with SWIFT_OPTIMIZATION_LEVEL = "-O";
Also, I've found that compilation mode needs to be set to Whole Module And I'm using Swift 4.1, It probably has something to do with some of the changes https://swift.org/blog/osize/
I found a way of creating a temporary fix that you can commit to the project
# Temporary fix for SwiftSVG Crash
post_install do |installer|
swiftSVG = installer.pods_project.targets.find { |target| target.name == 'SwiftSVG' }
swiftSVG.build_configurations.each do |config|
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = "-Onone"
end
end
Just wanted to say I'm running into the exact same issue. It's an important one because it's a bug that only shows up in release builds. @Robuske solution worked for me.
FYI, here's a very simple macOS project which illustrates the crash. Oddly it doesn't crash all the time and not always in the same place, but it does crash most of the time
+1, just found this issue today when distributing a build to stakeholders
+1. Found that turning off swift optimizations with @Robuske addition to the project's Podfile worked.
Hi! We have the same problem with our project. Maybe this crashlog can help you:
The app with SwiftSVG works fine when we launch it on our devices with xCode. But when we make a build and distribute it with TestFlight we have this error (from Crahslytics).
-- 0 | SwiftSVG | Identifiable.swift line 74_T08SwiftSVG12IdentifiablePA2A19SVGContainerElementRzrlE8identifyySS10identifier_tFAA8SVGGroupC_Tg5 1 | SwiftSVG | SVGParserSupportedElements.swift line 0_T08SwiftSVG12IdentifiablePA2A19SVGContainerElementRzrlE8identifyySS10identifier_tFAA8SVGGroupC_Tg5TA 2 | SwiftSVG | SVGParserSupportedElements.swift line 0_T0SSIegx_SSytIegirTRTA 3 | SwiftSVG | NSXMLSVGParser.swift line 142specialized NSXMLSVGParser.parser(:didStartElement:namespaceURI:qualifiedName:attributes:) 4 | SwiftSVG | NSXMLSVGParser.swift line 0@objc NSXMLSVGParser.parser(_:didStartElement:namespaceURI:qualifiedName:attributes:)
Line number 74 in Identifiable.swift is self.containerLayer.name = identifier
This doesn't use to happen me again.
Just download the recent master release, run on whatever device with release scheme or enable "Optimize for Speed" optimization level swift setting, and you will get different crashes based on which demo you try.