'Convert to latest Swift Syntax' breaks th

2020-07-10 05:36发布

My project is in objective-c with just one tableviewcontroller in swift. I downloaded the Xcode-beta today which prompted me to 'Convert to latest Swift Syntax'. After I follow the steps it shows me that there are no changes. I do not see any changes in the proj file either but it has errors. Please note that I do not see the errors when I choose not to covert to latest swift syntax - the app builds and runs fine in this case.

Any idea why it is breaking?

Screenshot added

Here are the errors -

  • cannot parse the debug map for "app name" No such file or directory
  • clang: error: linker command failed with exit code 1 (use -v to see invocation)
  • the other errors are that it is not able to find the swift file. The swift class was initiated in the objective-c class.

4条回答
姐就是有狂的资本
2楼-- · 2020-07-10 06:18

I had an issue similar to this, and I fixed it by changing the build phases/ compile sources in the project :

I had added in new sources that needed to be compiled earlier in the project, and after i deleted the files, when I tried to build the project it said it was missing the files that I deleted. After deleting a few of the build phases that appeared as though they were not the default build phases, it worked fine. I found that there were a default of 4 compile sources.

Also, using Ctrl+Shift+K will clean your project, which helped me another time with an error like this.

查看更多
一纸荒年 Trace。
3楼-- · 2020-07-10 06:19

Switch ENABLE_BITCODE to NO in project build settings helped me.

查看更多
劫难
4楼-- · 2020-07-10 06:26

I was having the same issue, and none of the above answers helped. Apparently, my issue was I had an import using a .m file instead of a .h file.

The easy way to find and fix these would be Find > Find in Project... and searching for #import.*m and changing them to the appropriate .h file

查看更多
男人必须洒脱
5楼-- · 2020-07-10 06:34

Product -> Clean helped in my case.

查看更多
登录 后发表回答