简体   繁体   中英

Compiling swift source files stuck

I have been working on my project when suddenly I have not compiled anymore, it stays waiting in Compile swift source files ... I cleaned the project, the folder, deleted the app and nothing. Is there any way to know what is happening?

Is there any way to know what is happening?

Yes. Go into the Report Navigator which is the one selected by the little speech bubble at the top right of the navigator pane. It will give you a list of all the actions you have performed like builds and tests and runs. The current build will be at the top of the pane. Click on it.

In the main editor you will see some buttons at the top and maybe some messages. Click the All Messages button and it will show you a tree view of the current build. The bottom line will be what the build system is doing now. If it is not changing (ie new lines appearing) the build is stuck.

Almost certainly the bottom line will be something like Compile SomeFile.swift . Assuming it is, you can now triage the problem. The Swift compiler usually gets stuck on inferring types for complicated expressions. The way to triage this is to comment out the entire file and then add lines back until the problem reappears. Make sure that you always add enough back so that the file compiles without error.

Obviously, the last line you added back will be the one causing the problem. Usually it's an expression that concatenates strings together with non strings that causes the problem.

The problem is in dictionary [String:Any] when I change the dictionary to [String:String] the problem is resolved . Is very strange..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM