fulldecent / swift5-module-template

An opinionated starting point for awesome, reusable Swift 5 modules
MIT License
450 stars 56 forks source link

Crash when using Swift standard libraries #38

Closed dm-z closed 5 years ago

dm-z commented 7 years ago

I've found an interesting crash, and I'm not sure what would be an ideal solution to fix it.

So steps to reproduce: 1) Generate a project from template 2) Add function to YourProjectName.swift func crushFunc() { print("Let's crash!") } 3) Compile the project for target "iOS Example" or "YouProjectNameTests", you don't even need to call a function, it will crash on launch

To fix this, I had to turn on build setting "Always Embed Swift Standard Libraries" -> YES for both targets (Example and Tests), otherwise it will crash on launch. But this fix will generate warnings if user wants to add Pod Dependencies to the project (Debug + Release for Example and Test targets - 4 combined warning when installing cocoapods):

[!] The iOS Example [Debug] target overrides the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES build setting defined in `../Pods/Target Support Files/Pods-iOS Example/Pods-iOS Example.debug.xcconfig'. This can lead to problems with the CocoaPods installation

fulldecent commented 7 years ago

That you for reporting!

Redonckulous problems like this are exactly why I created this project. So now we can go to the jury and say EXACTLY which REPRODUCIBLE steps we did to get into this hole. And then we can learn which step was wrong.

fulldecent commented 5 years ago

This appears to be fixed in the latest version.

Here is a complete test cast working with those steps.

https://youtu.be/RKXocrL22hc