I've created a new react-native project (0.61.5) and am trying to install react-native-track-player. The default installation docs are pretty sparse but after going through the issues I was able to successfully get the app running, just in a hacky way.
The solution I needed is found in this thread. Setting s.exclude_files = ["ios/RNTrackPlayer/Vendor/AudioPlayer/Example"]
in node_modules/react-native-track-player/react-native-track-player.podspec
works but I don't want to add it again every time my node_modules folder gets reset.
I saw in a different thread (and ended up using this as well) that setting the swift version in the Podfile to 5 in the post_install
method will set the proper version of swift for react-native-track-player to work. I thought maybe I could move the exclude_files
hack from node_modules podspec file to my Podfile and solve all my problems, only it seems to not work when set there:
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['react-native-track-player'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '5'
config.build_settings['EXCLUDE_FILES'] = '../node_modules/react-native-track-player/ios/RNTrackPlayer/Vendor/AudioPlayer/Example`
end
end
end
end
TLDR: Is it possible to set exclude_files in my Podfile in the post_install call?