I am building a module for React Native, as a part of this, there is some native iOS code that is wrapped in a cocoapod. I have this working fine, and I can install the cocoapod and see the native classes from the RN side no problem. One of the native classes is trying to get the path to a local mp3 file inside a sub folder proj/Audio/file.mp3
. Using the following ObjC code: NSString *path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"mp3" inDirectory:@"Audio"];
This is returning nil
and as such causing an error when trying to get the NSURL
for the file. I have the mp3 extension added to the podspec
@ s.source_files = "ios/**/*.{h,m,swift,mp3}"
so it is moving the file over. However, I assume I have to be missing something as it ultimately cannot find the file.
I have gone into the source xcode project and added the mp3
file to the Copy files
phase in build phases. I have also made sure that the file was linked to the target. I am not sure what else I could be missing at this point for it to not be able to be found.