Search code examples
swiftxcodewebp

webp file(Any unrecognized file) cannot be found in xcode bundle


It seems that webp file cannot be found and loaded through Bundle.main.url/path. But the gif file can be found. I use SDWebImage to load webp file from online url and it works:' You can see from below pic that both methods return nil file and on the left panel you can see the file is there. Any idea is appreciated.

error


Solution

  • I think I found the answer. For the file type(extension) which can not be recognized by xcode, you have to manually add it from project->Build Phases->Copy Bundle Resources: settings