Open SebastianOsinski opened 4 years ago
I'm having the same issue, but with one of my own names, for example:
Product/Module name: Foo Offending class/struct name: Foo
Workarounds:
PRODUCT_MODULE_NAME
build setting to something elseSame here. If project contains a struct that has the same name as the product, preview crashes.
I see this, too.
Description
Xcode SwiftUI preview crashes with error:
'ContentView_Previews' is not a member type of 'XXX'
whereXXX
isProduct Module Name
whenXXX
is the same as one of classes from Foundation or UIKit, e.g.UnitConverter
Steps to reproduce
Create new Single View App iOS project in Xcode 11.1(11A1027):
Expected behavior:
SwiftUI view preview should work
What actually happened?
SwiftUI preview crashes with error: 'ContentView_Previews' is not a member type of 'UnitConverter'. App runs on simulator with no issues. After changing
Product Module Name
in Build Settings toNotUnitConverter
preview works again.Files
Example project.zip