Shared internal framework not found after renaming

2019-09-09 05:15发布

I have a swift Xcode project say named Motorcycle and it has an internal framework shared among targets called MotorcycleKit. After I rename my project to Rollerblades I see in the project overview I now have a RollerbladesKit instead of MotorcycleKit. After doing a find and replace on import MotorcycleKit to import RollerbladesKit and running the app I get a module not found error on my import RollerbladesKit. How do I fix this error?

1条回答
Fickle 薄情
2楼-- · 2019-09-09 05:32

The Xcode rename function has a bug where it renames shared internal framework's Project Name to the exact literal of the new project name if the shared internal framework's name has the name of the original project in it. So from the question. MotorcycleKit has Motorcycle in its name and it gets replaced with Rollerblades instead of RollerbladesKit. You can fix this by going to your framework's Build Settings > Packaging > Product Name and correcting the name there, in this case by appending it with 'Kit'.

查看更多
登录 后发表回答