I found that if you change your user computer account name and home directory name using capital letters it breaks Xcodes canvas preview. All I did was update my user name "jay" and capitalized it to "Jay". Looking at the canvas diagnostic report, the path to the preview file uses a lower case verion of my account name in the directory path to the preview file, instead of the capitalized version. Everything else as far as I can tell seams to work correctly in Xcode with the updated capitalize account name. I tried to update the location path of the Derived Data to a custom path using my capital account name, but this didn't seam to make a difference. Is this a bug or are we required to keep the lower case user name? Thanks Jay. I'm mean jay. 🙂
Xcode canvas preview failing.
Apparent iPhone post, reformatted for readablity - HTH
I found that if you change your user computer account name and home directory name using capital letters it breaks Xcodes canvas preview.
All I did was update my user name "jay" and capitalized it to "Jay".
Looking at the canvas diagnostic report, the path to the preview file uses a lower case verion of my account name in the directory path to the preview file, instead of the capitalized version. Everything else as far as I can tell seams to work correctly in Xcode with the updated capitalize account name.
I tried to update the location path of the Derived Data to a custom path using my capital account name, but this didn't seam to make a difference.
Is this a bug or are we required to keep the lower case user name? Thanks Jay. I'm mean jay.
ARe you sure it is due to capital letter or to the fact you changed it.
Does the same problem occur if you change jay to jayman ?
Did you try to do an option- clean build folder (command in Project menu) ?
Make sure it is in your code. I accidentally didn't have it in one, and it drove me crazy before I figured it out!
//Add the PreviewProvider at the bottom of the code
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView() .previewDevice("iPhone 15") //or whatever
}
}
Sorry if this is a head-smacking duh for everyone... But as a newbie, it wasn't for me,
I'm a newbie... -Ashley