XCode 8.2.1 Cannot add folder reference

2019-07-03 22:10发布

My XCode 8.2.1 doesn't let me add a folder reference.

What I have tried:

I make a right click on the folder called "Unity", then I click on "Add files to Project...", under options I check "Create folder references".

folder references

My folder is added as a red file instead of a blue folder how it would be normally.

red file

I tried changing the 'type' of the file to 'folder' under "Identity and Type", then it becomes a light blue folder, but there are no files inside and I can't seem to put them inside in any way, and the name is still red.

blue - red folder

Then I manually choose location and the red is gone however there is still nothing in the folder.

identity last step

Someone might know what is happening?

1条回答
我想做一个坏孩纸
2楼-- · 2019-07-03 23:07

Once again proved the bugginess of XCode, so what solved the above described problem was one (or more) of these things:

  1. restart Mac
  2. open project
  3. clean, clean build folder, delete derived data
  4. try to add wanted folder again
  5. close the project
  6. reopen project and the wanted folder is drawn and painted as it should be, also containing all the files necessary

After a brief happiness, when I tried to build again I got a pbxcp error - "Data" - No such file or directory. Then I did:

  1. Open project settings
  2. Choose Build phases
  3. Remove the wanted folder from Copy Bundle Resources
  4. Click on the wanted folder in the project navigator
  5. Under "Identity and type" choose "Absolute path"
  6. Click on the little folder icon and choose the location
  7. Go back to Copy Bundle Resources and add again your wanted folder
  8. Compile

Good luck!

查看更多
登录 后发表回答