Xcode 11.4 compile error 'Missing package product <package name>'

谁都会走 提交于 2021-02-07 04:43:06

问题


When I integrate a local package in my Xcode project everything is fine initially but when i switch branches and want to run the app Xcode gives me the compile error Missing package product <package name>. When I quit Xcode and re-open it everything is fine again. Any idea what this can be? An Xcode bug?

We also integrate external packages via Swift Package Manager which works perfectly fine. No issues there.

The issue is also well described in a post by Jesse Squires.


回答1:


For me, I needed File > Swift Packages > Reset Package Caches




回答2:


In Xcode go to File > Swift Packages > Update to Latest Package Versions

Worked for me




回答3:


In Xcode go to Product > Clean Build Folder

This worked for me. The problem originally started when I was trying to solve another issue that came up after I deleted my Derived Data folder.

Restarting Xcode didn't work, but cleaning the build folder did. I don't know if the other answers here would work for me because I didn't try them seeing as cleaning the build folder worked.




回答4:


I'm not sure of the root cause, but I get this quite regularly. Not the most elegant solution, but neither Reset Package Caches nor Update to Latest Package Versions worked for me. For me, I had to quit Xcode, and delete DerivedData.

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Then rebuild.




回答5:


In Xcode 12.0.1 (12A7300) this bug has been fixed. At least I don't get it anymore 🎉



来源:https://stackoverflow.com/questions/60952549/xcode-11-4-compile-error-missing-package-product-package-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!