On Xcode 12.1, SwiftUI Previewer crashes when it references another swift package it depends on and that swift package uses Bundle.module.
Basic code snippet that crashes:
		import SwiftUI
		import Theme // Import package that uses Bundle.module
		/// This view will crash the previewer
		struct ThisViewCrashesPreview: View {
				var body: some View {
						Text("Hello, World!")
								// If you comment out the following line, the previewer will render
								.foregroundColor(Color.themeGreenFromXCAssets)
								// Or use this line, the preview will also start to work
								.foregroundColor(Color.colorThatDoesNotUseModuleReference)
				}
		}
		struct ThisViewCrashesPreview_Previews: PreviewProvider {
				static var previews: some View {
						ThisViewCrashesPreview()
				}
		}
Code from Theme package:
		import SwiftUI
		public extension Color {
				
				static let themeGreenFromXCAssets = Color("ThemeGreen", bundle: .module)
				
				static let colorThatDoesNotUseModuleReference = Color.init(red: 0.3, green: 0.6, blue: 0.9)
				
		}
Crash Log States:
Application Specific Information: Fatal error: unable to find bundle named ThemeTheme: file Theme/resourcebundle_accessor.swift, line 27 Same issue reported here: https://stackoverflow.com/questions/64540082/xcode-12-swiftui-preview-doesnt-work-on-swift-package-when-have-another-swift/64664692#64664692
To reproduce:
Download code at: https://github.com/ryanholden8?tab=repositories See repo SwiftUI-Preview-Failing-Test-Project
Open PreviewFailingTestProject.xcodeproj
Change Target at the top of the Xcode window from PreviewFailingTestProject to MyUICode
Change deployment device to iPhone 12 mini (or any iOS device)
Open file: LocalPackages > MyUICode > Sources > MyUICode > ThisViewCrashesPreview.swift
Try to use the SwiftUI Previewer
Crash will occur and preview will not render, see lines 8-11 of ThisViewCrashesPreview.swift for more details
NOTE: See file: PreviewFailingTestProject > PreviewFailingTestProjectApp.swift > MainWindow View on lines 13-19. This renders fine on both the SwiftUI Previewer and when deployed to device.