cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.16k stars 7.05k forks source link

iOS FileUtils::fullPathForDirectory return empty #20730

Open Chuanqi927 opened 2 years ago

Chuanqi927 commented 2 years ago

Steps to Reproduce:

  1. create new folders under Resource folder and put some resource files inside it.
  2. use cocos2d::FileUtils::getInstance()->listFiles(dirname); to get files inside a directory.
image
stevetranby commented 2 years ago

If you haven't found a solution yet, you probably need to check that the fonts folder is in the iOS target's project's settings: BuildPhases > Copy Bundle Resources. You could also select the fonts folder in the project navigator and then "View > Inspectors > Show Inspector" (or use key combo: CMD+OPT+0) to confirm that both iOS and Mac targets are selected for the folder's membership.