Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SwiftUI Preview - Failed to Build Scheme, No such module "ProjectName"

I am trying build a Preview for a project that is built on SwiftUI. At first, I created the project with the name 'VOIP'. After some development and time, I connected it to the AppStore Connect and the name of the project was created differently, Let's say VoipApp. I can build the project into simulator or a device without any problem, however when I try to preview a SwiftUI View, it says No such module VOIP at project navigator. But as I said it just happens when I try to preview.

Here is the diagnostics;

no such module \'VOIP\'

----------------------------------------

SchemeBuildError: Failed to build the scheme "VOIP"

no such module 'VOIP'

Compile /Users/myuser/Projects/VOIP/VOIPTests/VOIPTests.swift:
/Users/myuser/Projects/VOIP/VOIPTests/VOIPTests.swift:10:18: error: no such module 'VOIP'
@testable import VOIP
             ^ 

I tried some answers from the network, but neither of them have been worked.

like image 709
Faruk Avatar asked Mar 02 '20 17:03

Faruk


1 Answers

The comment about recreating the scheme did not work for me. However, I found that I was able to change the module name to the value expected by SwiftUI by editing the "Product Module Name" setting:

enter image description here

like image 71
Jeffrey Wear Avatar answered Sep 27 '22 17:09

Jeffrey Wear